Refactored physics.js. (closed #15)