Change writeln()s of format()ed strings to writef()s

This was written before we had writef() in the library, so it
used a number of format() conversions which are pretty ugly
and heavyweight.  Changing to writef() for simplicity and
clarity.