Move curses UI code to its own files