Move key handling to the frontend

This is PR #1275, but as a pull request on `post-1.46`. This makes the diff much more manageable to look at. To quote #1275:

> This PR begins work on #1274.
* Key handling has been moved to a content script (`content_scripts/key_handling.coffee`).
* Key handling is now done synchronously as part of the event's key handler.
* Checks on whether we handle a key are all done using the same code. This ensures consistency (eg. now we don't pass `0` to the underlying page if we've handled it ourselves as part of a number prefix).
>
> ...
>
> Apart from bugfixes coming from unifying the frontend and backend key handling, this should function the same as before.