Fix whitespace in .toString() output.

* Remove an extra space at the end of opening tags
* Add a newline after each tag to avoid very long lines.