Complex sensory-motor sequence learning based on recurrent state representation and reinforcement learning