Create an interface for dealing with terminal

The Terminal class now derives from an interface to better support
validating application output without ncurses hackery.