Fixing tests - start server from temp dir so doesn't interfere with git clean. Also add retry functionality to ensure connection is available.