correctly listen for network error events

unit test included.

aaronj1335/IRC-js@0a6b471 tweaks some of the unit tests so they're passing and adds a `test` target to the makefile to match [the readme](https://github.com/gf3/IRC-js/blob/master/README.md#tests). if this commit needs to be excluded, that's fine, but i figured it'd be better to have strictly passing unit tests than wait til the `chan.join` callback thing is fixed.

i'm going to try to [re-add ssl support](https://github.com/gf3/IRC-js/issues/20) if that's cool (or am i missing it somewhere?), so this is just to support that.