Further work on GUI, settings, and live preview

GUI is now mostly functional for mode=1, settings do not apply yet, but
have been restructured to make this easy. A first live preview is now
available by capturing a small frame on every loop.