Basic XTerm support

This set of commits implements XTerm support (command and key sequences) enough to run Midnight Commander with the same level of comfort as in XTerm on typical Linux X Windows install: switching panels on/off to access underlying shell screen works, almost all keys work, etc.