Added tests and tracing to message processor.