Updates to use karma tests.
Adds ability to load a script in a different document.
Fixes document usage.
Merge pull request #5 from alexgorbatchev/patch-2

Adds ability to load a script in a different document.