Added socks5 client.

Added socks5 client, optimized code. Cleaned up a few methods.