Reconfigured to be compatible with require.js