A week's worth of cleanup

I was on vacation for a week, and this is (the first half of) the result.  Each commit should explain itself, let me know if you want me to break things up more or submit these as separate merge requests.