Added the handlers for XMPP and tests for them.