Haddock writer:  use 'text' builder instead of 'str'.

This articulates strings into Str, Space, allowing them to be
hard-wrapped intelligently by the writers.

This patch also fixes a bug with trailing spaces and newlines.
(See #806.)