Use window as default global

In a CommonJS environment `this` references the module, not the `window`. Thus, when using rest with something like Browserify the XHR adapter is not able to find `XMLHttpRequest`. This patch addresses this issue.