Force some consistency on structure and function names

Rename principal structures to Tg* and all functions to tg_*, in
preparation for converting everything to a more conventional GObject
structure.  No functional changes.