Fix reconnection issues

I think this resolves #58 and #63. When ejabberd - and I assume other xmpp servers - are hard reset node-xmpp gets a `ECONNREFUSED` error which prevents the `reconnect` option from working. In these situations, the `end` event is emitted. The adapter now handles this event and attempts to reconnect.

If this reconnection process fails the bot process will be terminated. This will allow process managers like supervisord to restart the bot.