Updates to improve validation of the html
The generated html is not valid html or xhtml. This MR improves the compliance to XHTML transitional (not strict). There is still the possibility that one <ul>
element is empty (a ul element should contain at least one li element) which I cannot solve trivially, it seems to be related to the caching mechanism.