First pass at splitting JS into separate files and using require.js
Make modules return a function