[Browserify support] Sets module.exports now, in addition to exports

Now has proper type checking for usage in browsers, will not throw an exception if module.exports is missing.