Setting up node for XMPP, refactoring messaging service and facebook service