Moved connect (join default channels) and disconnect (quit if all connections closed) handlers from the core code to the core submodule.