consistently check for browser environment

This PR updates the browser check to properly detect the browser
environment even if browserify does not shim the `process` variable.

This is important in setups where users include the library in projects
that skip detection of globals (speeds up builds) and aim not to include
shims (e.g. process).