Replace linear lookup with hash table, reducing runtime by 60%.
Import my terminfo implementation.This uses the ncurses terminal definitions.OK: core@, jdc@