Generative Temporal Models with Spatial Memory for Partially Observed Environments