Correct counter in "Log" button: show count of unread messages
(#15)
Refactor handleConsoleMessage()
(preparation for #17)