Implemented message handlers.
Changed messaging system to handle messages before the processing step.