npm support

made it require-able through npm.

also fixed passing the socket to the listeners.