Reinforcement Learning with Exogenous States and Rewards