HtmlFormatter fixes

* Don't fixup HTML if  it hasn't been ruined by libxml2
* More detailed profiling

Change-Id: Ieabce23819f7563fdf17e3f1dfd621d853dae589
Merge "HtmlFormatter fixes"