Refactored and modularised using require.js

* Engine project needs a name...