Use more standard test to expose CommonJS module

`typeof exports === "object"` isn't a complete test for defining on module.exports, unless I'm crazy? Perhaps you wanted to do something unusual here?