Refactor plaintext formatter, improve output.

Add a new Formatter class and use the `linewrap` package to word
wrap the output.

The word-break code is latin alphabet only at this point, no bidi
support.