Refactored engine. Webworkers do not work any more, but they will be soon.