Cleanup URL handling in ScriptTask::load a bit.

This should make it clearer that we always pass a URL to Document::new, and
avoids an unnecessary unwrap() call.