Fix newline handling

This filters out extraneous newlines from plain text (avoiding manipulating verse blocks), and removes unnecessary newlines around tags.