Switch TypeFunc and ScalarTypeFunc from completely static
classes to namespaces. They functions share no private data
between them (and it seems unlikely that they ever will) so
there is no benefit to being class functions.
Also misc. cleanup of static string defs, and comparisons.