Add ability to Marshal.dump/load PG::Type objects.

This should help to use PG::Type in ActiveRecord.

This also fixes base classes for Composite coders.