decoupled client from main, use channels (synchronous) for communication between main loop and XMPP client