Use require.js

does not currently work, need to fix.