Extended html output

And some refactoring to make it more usable.