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.
They're preserved "magic numbers" from the old setup. They give room for the status line at the bottom. In order to fill the entire screen, it should be height - 1, whereas -3 clears the last 2 lines, making room for the status line. In the future, I believe the input field would use the last line (That is at least my personal intention - I had a few local in-progress implementations that way, at least)

Anyway, the logic have not been changed.