Issue 21

Started a major formatting and refactoring overhaul, mainly fixed xmpp.py, alas fixes #21