Converting type map to a hash lookup.

A next step might be to make constants for the SQL types.