run-tests: allow TestRunner to be passed into main()
This allows 3rd parties to specify a custom TestRunner. This is useful
for providing your own test discovery mechanism, for example.
run-tests: move test discovery logic into a function
The new function is easily monkeypatchable. This facilitates more
advanced test discovery by 3rd parties such as extensions.