Refactor socks package. Add support for socks4/4a.

Related to #2567 
This change is backward incompatible. 
Seems like this became public.  Could you explain why?