Setup special keybindings using terminfo

The support for special keys right now is simply with hardcoded values,
this commit changes that to using terminfo information for the keys to
set the binds.  Should be much more general, and just work.  This also 
fixes a bug in the vi-mode plugin where the special keys were not bound 
because setting vi mode removes binds set in emacs mode.

Fixes the problem with 53854754e0d052 not setting the special key 
keybindings and those keys not being recognized when using vi-mode.