Bug 869832 followup, use the test window's gBrowser
Bug 870959 - don't include Preferences.h or NonRefcountedDOMObject.h in bindings unless necessary; r=bz