Setup and refactor messaging system.
Additional merging.