Add missing imports
Bugfix. Get the XMPP host from the registry settings
Move to utils and found more places where applicable