Got `socks.py` to run.

- Fixed some syntax errors.
- Corrected `SOCKSFactory` made it simpler.
- Fixed some renaming errors.
- Fixed some import errors
Got `socks.py` to not crash when it runs, but I can't test it fully yet.

- Fixed references to `_cursor`.
- Fixed the usage of the `Enum` classes.
- Gave `_handleBadHandshake` an error message parameter.
- `log.mesg()` -> `log.msg()`