pyflakes, pep8 cleanup and use build_local_tor_connection() instead