fixed some scope issues and use simple-xmpp function to send messages, updated tests