OOP version of HTML tidy