Move TUI-related code to its own file.
This is essentially a gutted fork of nncmpp that doesn't do anything.