Do not override document variable, use doc variable instead
Merge pull request #3 from OliverJAsh/patch-1

Fix issue where document variable is overriden and undefined when run in the browser