implementation of require.js