Add CommonJS support

It would be great to publish this to NPM as well (for use with Browserify).