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