Clean up some code in patriciaLib.

The code for PTREE_PEEK_CONV is now a bit less opaque and ever so slightly faster. Quite a few of the other conversions could do with similar treatment.