Learning Representation and Control in Markov Decision Processes