Beyond Inverted Pendulums: Task-optimal Simple Models of Legged Locomotion