Made format_*() functions into impls on Writer
Made format_*() functions into impls on Writer

This looks like more changes than it is. The actual body of every
format_* function (format_document, format_comment, etc.) is still the
same. They were all just shifted into an impl on Writer and made to
accept &self, which gives them all access to the settings.

Additionally, a stub module-level format_document function was added
that maintains compatibility with the old document formatting.

shepmaster/sxd-document,shepmaster/sxd-document