Adds ability to load a script in a different document.

Can now specify into which document the script should be loaded.