Implementation of require.js and r.js optimizations