Small refactorings of HtmlUtils.java

Reduce scope of some variables, add @Override annotations, etc.
Closes #403
Add empty lines between constant variables