Add getopt support

ncurses and SDL code paths
move input code into their respective libs