Initial work on terminal-independent code.