Moved `socks.py` into package; moved its test code.