Remove explicit dependency on window
Merge pull request #3 from jrusbatch/window-dependency

Avoid directly depending on the global window variable