remove sprintf from format()

We now construct the output line by hand.  Removing sprintf from the
main loop is a big speed boost.
make the in/out prefixes more visually distinctive