Add browser checks so it can run in browserify/webpack environment

Great module! I've modified it so I can use it for server-side rendering with my React mixin (see https://github.com/jeroencoumans/react-fullscreen-component).