editor HTTP handler: add tests, refactor, add support for "search in repository"
Created by: slimsag
This change does three things primarily:
- Adds tests for the Sourcegraph editor HTTP endpoint (which is what the editor extensions produce).
- Refactors the code to be more readable and extensible in the future.
- Adds support for "Search in repository" (previously we only supported global search) as requested by a large user base in https://github.com/sourcegraph/sourcegraph-jetbrains/pull/13
Best reviewed commit-by-commit as this is a large change.