Generalization of Agent Behavior through Explicit Representation of Context