Use `module.exports` when in CommonJS environments instead of `window` global
Merge pull request #3 from ForbesLindesay/patch-1

Use `module.exports` when in CommonJS environments instead of `window` global