Just tossing this patch here for the testbot. It will likely crash and burn but I want to get it out there. :-) I'll provide a proper summary tomorrow after I've had a good night's sleep.
There's also a related issue that I believe Wim Leers and Berdir were in, but I cannot find it now. Something to do with a dialog or modal or something returning a generic 500 error rather than useful information. This issue would pave the way to fixing that. If someone knows what issue I'm talking about please add it here. :-)