Fix unicode handling in 'View HTML code as formated text'. Fixes #667
Optimizations and better newlines handling
Resolve merge conflict for pull request #13
Merge branch 'enikesha-htmlfix' into merge