Towards mental time travel: a hierarchical memory for reinforcement learning agents