Added support for browserify

If the exports object is defined then it is used instead of the global window object