Starting refactor of messanging code into separate class. Needs more work to be easily re-usable, but can be re-used easily by prism add-ons