Some small REPL fixes

- Color is now per-repl rather than begin set globally.
- History navigation skips unrecognized modes (e.g. the debugger)
- Fix a bug where repeated characters would not be matched correctly
  in rsearch (e.g. `ll`)

Add a testcase for the last two
Merge branch 'kf/hist'