Move rendering logic to a html renderer, add enum classes and add more functionality (with tests)