Refactoring to run physics in a worker. WIP.