Moved the connection and configuration of XMPP to the log-in process.