Added basic auto-reconnect logic and nick reclaiming.

Nick reclaiming doesn't take into account any errors that the server
might send back but, then again, the server doesn't send back any errors
yet... :)