Converting to Require.js module loading throughout