Added support for AMD/require.js loading