Replace "window" references with "win"

Change all "window" references in "libraries.js" to use the injected "win" argument.