Fixing tests

@anpete Start server from temp dir so doesn't interfere with git clean. Also add retry functionality to ensure connection is available.
Have updated this to look for TEMP as well as TMP - just in case. Now I'll only throw if can't find either of them.