Various small cleanups, with focus on logger and history window
Some random things I came across previously. I especially wanted to change the use of big, unnamed tuples in the communication between the history window and the logger module.
The commits regarding the conversion to named tuples contain intermediate steps as to make it easier to review. They can be squashed if you want.