Added fixup_html_message() to add missing HTML tags.  Misc code cleanup.  fixes #7785
Merge branch 'dev' into test