Update scripts to use require.js