Mechanisms of Contextual Memory and Goal-Directed Behavior in Humans