Many improvements to HTML generation.