[hack] Refactor / boilerplate for D10100451
[hack] Refactor / boilerplate for D10100451

Summary:
This diff has everything!

- add new config option
- add new exit code
- thread `genv` variable to some places where it's now needed
- add missing `.mli` file
- make it possible to `set_changed_mergebase` back and forth, and not only from `false` to `true`
- rename `check_changes` to `check_blocking` (to make it clear that it blocks, and in contrast to `check_non_blocking` added in next diff)
- factor out part of `check_changes` into a `check_query` helper (which will be re-used in `check_non_blocking`)
- stop threading timestamps from `ServerTypecheck` through this function, since it does more confusion than help

Reviewed By: 2BitSalute

Differential Revision: D10100448

fbshipit-source-id: 2ea0daf6c11290dff682b5763f531c05b27d3415

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow