First move in isolating logic

I removed the setup, resize and input logic from loop, so it only sets up and listens on its channels. createFrontend should see further reduction in the future.

Unittests slightly expanded, although they contain rather "stupid" tests. I wasn't particularly creative there.

I hope this is good enough as a "first step towards simple logic and unittestability". I am happy to hear if there are any ideas or criticism towards my approach.
Indeed. I'd prefer having them as declared constants with descriptive names, just as you mentioned. Magic numbers always raise questions. I simply didn't put too much thought into it as I shuffled the code around. I will in a future commit.