fix error on xbmc shutdown

node_modules/xbmc-ws/node_modules/jrpc-schema/parsers/result.js:18
                throw error;
                      ^
Error: Response was not a valid json string
    at parseResult (node_modules/xbmc-ws/node_modules/jrpc-schema/parsers/result.js:15:11)
    at WebSocket.ws.onmessage (node_modules/xbmc-ws/xbmc.js:20:9)
    at WebSocket.onMessage (node_modules/xbmc-ws/node_modules/ws/lib/WebSocket.js:360:18)
    at WebSocket.EventEmitter.emit (events.js:98:17)
    at Receiver.self._receiver.ontext (node_modules/xbmc-ws/node_modules/ws/lib/WebSocket.js:697:10)
    at Receiver.opcodes.1.finish (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:397:14)
    at Receiver.expectHandler (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:384:31)
    at Receiver.add (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:93:24)
    at Socket.firstHandler (node_modules/xbmc-ws/node_modules/ws/lib/WebSocket.js:678:22)
    at Socket.EventEmitter.emit (events.js:95:17)
fix TypeError: Uncaught, unspecified "error" event.

events.js:74
        throw TypeError('Uncaught, unspecified "error" event.');
              ^
TypeError: Uncaught, unspecified "error" event.
    at TypeError (<anonymous>)
    at WebSocket.EventEmitter.emit (events.js:74:15)
    at Receiver.self._receiver.onerror (node_modules/xbmc-ws/node_modules/ws/lib/WebSocket.js:719:10)
    at Receiver.error (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:301:8)
    at Receiver.opcodes.1.finish (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:394:16)
    at Receiver.<anonymous> (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:384:31)
    at Receiver.add (node_modules/xbmc-ws/node_modules/ws/lib/Receiver.js:93:24)
    at Socket.firstHandler (node_modules/xbmc-ws/node_modules/ws/lib/WebSocket.js:678:22)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:746:14)
add events for error close and connection
move init to init function to allow reconnection
add examples
Merge pull request #2 from Links2004/master

fix errors and allow reconnect