Merge pull request #3 from rfw/master

Fix error behaviour and edge cases.
Merge pull request #4 from rfw/master

Also catch socket.error on TLS teardown.
Make exception handling on sockets more robust.
Parse parameters as parameter* and not parameter+.

Some IRC commands have no parameters and this accomodates for them.