Simple javascript vector-based physics engine