Initial work to establish connection to XMPP server.