Add ability to run tests locally before deploying

Add a `local_hook()` function to run a local hook command, and a
`local-test` config key to take advantage of this ability.

This is useful in situations where server-side testing infrastructure
is not set up or is not desirable, and local testing before code is
deployed becomes even more critical.