Move GTest build to test/ top-level

It's now used in several different tests, but can be built only once. Do
it where it makes sense.