changed old codebase to use require.js