Embedding Reward Signals into Perception and Cognition