Patch Set 2: I would prefer that you didn't submit this

(3 inline comments)

Aside from these inline comments, I want to submit I7c7a05e443a48d32c836173a409ee7d340c70796 first, as this has quite a few merge conflicts due to the refactoring.