Added code+test to check for redefine of coverage var and passing window as a function parameter
Added inBrowser to redfinition conditionals
Moved window redefinition code into separate function
Merge pull request #256 from alex-seville/windowRedef

Check for redefine of coverage var and passing window as a function parameter