Added logging functionality.

The log is hidden by default, which can be toggled by a supplied button. The mark-up is invalid, appearing outside the html tags - will be fixed later.