Add missing dependencies.
Use threads for test servers.

We prefer threads, as it guarantees server shutdown on process shutdown, while
providing a close enough approximation for our needs.