Planning to Be Surprised: Optimal Bayesian Exploration in Dynamic Environments