Use context variable rather than direct references to window/navigator
Use context variable rather than direct references to window/navigator

This fixes issues with trying to run tests of code using the crosstab
library when running with mocha without a browser.

tranphuoctien/crosstab,tranphuoctien/crosstab,scaryzet/crosstab,tejacques/crosstab,scaryzet/crosstab,tejacques/crosstab,tejacques/crosstab