Switch type encoders to PGType class

Having both BS and String versions may be overkill, but we'll see.
I gave up on using ShowS for the literals at least.