Improved performance by removing json marshalling for simple messages. Added more tests.