Remove redundant uses of window.*

Very simple PR, removes redundant uses of `window.*`, there's no point in doing `window.abc && window.abc()` as we already know `abc` is global when it's time to execute it.

Reject if you don't feel like touching all the different lines for "no good reason".

PS. Alternatively enforce use of `window.` everywhere it makes sense (i.e. not for Array), but that might be rather redundant and heavy-handed.
You can access undefined properties on anything that isn't `null` or `undefined` so that won't throw an error. Your code will throw an error if for whatever reason `document = null`