Emacs bindings, misc build fixes

Could do with being smarter to properly handle C-w and add C-k but this is a good start.