Add onMessage(), onClose() and onErro()

I suggest adding those three methods:
 * onMessage() was added by eventedMind for his screencast, it's a great way to see what's going on
 * onClose() and onError() allow you to re-connect when something goes wrong.