Remove obsolete termcap support
term: Separate key caps from other string caps

Also add NR_KEY_CAPS so that you can add keys that are not defined in
the terminfo database.
Terminal initialization cleanup

Abort if TERM isn't set instead of defaulting to "linux".

If terminfo file can't be read display correct error message and abort.
Move isatty(1) check after command line parsing

This makes things like "dex --help > file" work.
Move builtin keymap out of read_special()
Add sup and sdown keys (shifted up and down arrows)
Log key code when DEBUG > 2