FYI I found the conflicting `glob` objects (the one passed to the factory that references `window` and the one being created here) to be a bit of a head-scratcher. 

Is it really worth the potential misdirection to save a handful of characters? Wouldn't a module scope `win` and `doc` be just as useful without needing to shadow the other `glob`?