Changed onexception() to onerror(), fixed some typo's
Started testing and debugging:

- Renamed exceptions.py to errors.py to avoid name collision with stdlib
- Fixed some variable name collisions
- Worked on improving close handshake
- More minor fixes