Add require.js and start refactoring existing code to use require modules