[TIDOC-1901] Add module HTML feature and some more refactoring