Refactor keyboard handling to have extensible per-tab shortcuts