Add escape handlers

Allow handlers to be added based on escape code.  Allows handling of
special keys like the left and right arrows.