Added support for AMD (Asynchronous Module Definition) libraries such as require.js