Copying over test kit

This is from is from @alkemist. I merged in the logic to choose a GradleLauncher or to use Tooling API. The launcher is richer, giving you the full state of the Gradle, the tasks run, and the ability to debug. But it will not be supported much longer, and it might not work in 1.12.