Add user-defined healthcheck (#2652)
* Allow user to define healthcheck function
* Add integration tests to verify behavior
* python 3.8 compatability fix
* Accept suggestions from comments
* Fix tests
* test: cover healthcheck unhealthy statuses
---------
Co-authored-by: Nikhil Sinha <nsinha@cloudflare.com>
Co-authored-by: morgan fainberg <mfainberg@cloudflare.com>