Refactor type decision making

Type decision making was extracted into FormatType objects.  Each object knows how to format a specific datatype, and FormatTypeFactory is responsible for returning a FormatType for a given format string.