Hello again,
I have now committed 0001.
I got some off-list review of 0004; specifically, Michael Paquier said
it looked OK, and Tom Lane found another bug. So I've added a fix for
that in what's now 0003.
Here's v2. I plan to commit the rest of this fairly soon if there are
no comments.
...Robert