Draft GUI + fleshed out input handler

pygame GUI now works somewhat, with the background event handling quite
far done. Streamlined the GUI mode selection. Init and cleanup
functions added to make main easier to read.