expanded to support for commen.js AND amd-style (require.js)