Bug 901106 - Deserialize FastLoad scripts into the compilation scope, rather than the scope of the first document created. r=smaug

This code dates back to 2003, and smaug and I both think it's probably a bug.
In fact, it might cause leaks, because the prototype document would hold the
script alive, the script would hold the document alive, and the document would
hold the prototype document alive in the cache.
Bug 901106 - Inline and remove nsIScriptContext::{Serialize,Deserialize}. r=smaug
Bug 901106 - Be more direct in nsXULPrototypeScript::Compile. r=smaug

Given that this is just the phony compilation global we're dealing with, the
only thing relevant about this script context is that it defaults to the right
compartment. But we can do that manually with the SafeJSContext.

The CanExecuteScripts check was something I added to address review comments
in bug 901162 comment 8. I now realize that it's effectively a no-op, because
the nsIScriptContext here corresponds to the compilation scope, not the
document, so it will never have script disabled.
Bug 901106 - Pass nsXULPrototypeDocuments directly through serialization and use AutoSafeJSContext at the serialization point. r=smaug
Bug 901106 - Stop implementing nsIScriptGlobalObjectOwner in nsXULPrototypeDocument. r=smaug
Bug 901106 - Stop using nsIScriptContext for XUL prototype documents. r=smaug

This patch is roughly analagous to what I did for XBL compilation scopes in
https://hg.mozilla.org/mozilla-central/rev/26898c90f9cc.

According to CC dumps, the gray unmarking during MarkInCCGeneration prevents this
stuff from being traversed during CC.
Bug 901106 - Remove nsIScriptRuntime. r=mrbkap

All this stuff is now for nsGlobalWindow's use only.
Bug 901106 - Make sure sure the nsDOMScriptObjectFactory gets instantiated.

This used to happen implicitly when we created the first nsJSContext, but that
goes away in the next patch. Without this, we get a couple of odd exception-
related failures in the IPC indexedDB tests.
Bug 901106 - Get rid of vestigial nsJSRuntime instance and make it a namespace. r=mrbkap

We'll rename the namespace shortly.
Bug 901106 - Make nsJSRuntime initialization infallible and do it implicitly in the nsJSContext constructor. r=mrbkap

We also move the runtime out of the namespace, which requires some updates.
Bug 901106 - Eliminate the nsJSRuntime namespace. r=mrbkap