I took another look at the updated version today. Since there now were some unused variables and (I believe) unnecessary checks (int size and endianness etc) left, I took the liberty to fix those. I also fixed some markup in the catalog docs, did some minor tidying up and ran pgindent on it.
The attached is a squash of the 4 patches in your email with the above fixes. I'm again marking it RfC since I believe all concerns raised so far has been addressed.
> Added the test case that Daniel had created.
Nope, still missing AFAICT =) But I've included it in the attached.