OK, so this worked out quite well ... it's only about 50 net new lines
of code, and there's no data structure changes outside the contents of
compiled expressions, so no reason to fear ABI problems.
I did the renaming you had comments suggesting, but perhaps you want
to bikeshed those names?
regards, tom lane