Fixed browser and old require() API compatibility

Heavily inspired by how `underscore.js` makes the export.