Better CommonJS/AMD support, Fix browserify issues

Fixes issue #74 - module.exports being empty when using Browserify