Export to HTML file instead of PDF

* Added: methods to export to HTML file
* Changed: cleaned the code organization