Move some more code related to Ncurses to UI
Declare vars first
I'm afraid we're loosing packets... #27