Trajectory loops over walkcycle repeats, which is Ok but it should call WalkCycle methods in that loop. Similar for WalkCycle and Phases. Also, move that stuff to cpp!