added support for commonjs modules

Hey there,

This PR adds support for commonjs modules, browserify etc, sometimes used in environments where the 'window' object isn't available, but JSON is.

Steve
We can't make this change. This is very significantly different in behavior.

`(JSON && JSON.stringify)` will now raise a `ReferenceError` instead of returning `undefined` as `window.JSON` would.