Use require.js for main function
Work towards requirejs integration