Use the Writer trait instead of String; Fix #16

This allows us more flexibility in how we build the output. The example has
been updated to show how to write directly to stdout or to a String first.
Additionally, the format! macro can be used to generate strings, making the
formatting part of of #16 orthogonal to building the output.