add basic compatiblity with browserify

adds basic compatibility with some browserify idioms, process.browser to check if we are in the browser or not, and global as a shortcut to whatever the global object happens to be