A Recurrent Memory Model Implementation of Reinforcement Learning