Refactor server code
Load files using require.js