Physics engine refactored a bit more usefully