Peter Geoghegan has been doing a lot of great cleanup of the jsonb code,
after moving in the bits we wanted from nested hstore. You can see the
current state of the code at
<https://github.com/feodor/postgres/tree/jsonb_and_hstore>
I've been working through some of his changes, I will probably make a
couple of minor tweaks, but basically they look pretty good.
I'll be travelling a good bit of tomorrow (Friday), but I hope Peter has
finished by the time I am back on deck late tomorrow and that I am able
to commit this on Saturday.
cheers
andrew