Linearizing Contextual Multi-Armed Bandit Problems with Latent Dynamics