Remove circular requires.
Wait for socket instead of pid file in tests.