added debug mode, xmpp login status, thread for xmppConnect