Fixed bug in server, updated client side code to use require.js