Intelligent problem-solving as integrated hierarchical reinforcement learning