Generify text formatter

Make ITCH formatters more generic so the functions can be used for other
protocols as well.