support loading as modules (e.g. using require.js or browserify)
Merge pull request #253 from LaurensRietveld/master

Allow loading as module