support loading as modules (e.g. using require.js or browserify)