Self-review.

There's a lot more left to do on this CL but I'll do that in follow-up CLs.
This one has already grown way too big and needs to go in.