Improves support for running inside of a browser, and from inside grunt scripts