Adaptive Path-Integral Autoencoders: Representation Learning and Planning for Dynamical Systems