Reland Uplifted changes for Bug 925398 (includes Bug 945284, Bug 947001)

I backed this out earlier thinking it was responsible for a Gu failure in tbpl, but it was not.