Major improvements to HTML generation.