implemented really simple mode-based input processing. fixes #1, fixes #2, fixes #10, fixes #6