Updated Messaging code. It's a bit nicer now, plus it actually works.