Added basic logging. This required some refactoring of the HTML layout generation.