Fixing tests

@anpete Start server from temp dir so doesn't interfere with git clean. Also add retry functionality to ensure connection is available.
Changed Environment.GetEnvironmentVariable("TMP") to tempPath.