Refactor Message Event (XEP-22) code to current design