eliminiated references to globals "navigator" and "document".

changed to "window.navigator" and "window.document" so that the injected
"window" instance is used.
Merge pull request #287 from crazytyper/eliminate-global

eliminated references to globals "navigator" and "document".