added HTML5 support and some merges from tidy lib