Trep: Mechanical Simulation and Optimal Control