Flow control code & start on the UI

Flow control uses threading and queues, is parameterisable through the config.py file.

UI is a work in progress, don't try to use it yet or you'll get burned.