add support for AMD/require.js loading