Emitting the close event when the client closes.
Merge pull request #20 from mcollina/close-event

Adding a 'close' event for client usage