Change window to global in the most outer IIFE parameters. (cherry-picked from dc649a33e081c7beb083b04956731aa410eb6b3f)

In the most outer IIFE it’s not yet known if the global is window or not.
Using the window variable to denote the global was misleading in that case,
especially that the code didn’t make such assumption, requiring to provide
a Web-like window separately. Renaming window to global clears the confusion.