Free-body mechanics / physics engine in javascript