Learning Latent Dynamics for Planning from Pixels