Simple JavaScript phsysics engine