tiny readline-alike with some batteries included

various notes:
- if you've got a prompter that can run a command, you should set $MADELINE_MODE
  to made::modestr(s.mode)
- never set s.mode directly, always use set_mode
