modified such that wrapped code runs in window context
added tests for case where wrapped code requires window context
Merge pull request #1 from sfrdmn/window-context

Some wrapped code requires window context to work