refactored RequireJS code so that `shim` is used for loading non-AMD modules - makes `r.js` dependencies easier