[tor-commits] [tor/master] Rewrite managed proxy environment setup code