Remove some secondary uses of Type

A grab-bag. The common theme is that Types are being used when something simpler / more modern is available. Particularly a TClass / TInstance. Each commit is pretty much self-contained, usually in a single file.

Once again, the goal is as much compatibility as feasible. In particular, a couple of fixes in mapping to Postgres oids are deferred, since they would change YAML expected results. But there are TODO comments about them for after this round of changes settles down.