Added unit tests to JSONLayout and fixed class accordingly

The JSONLayout incorrectly wrapped the JSON representation of the
message in a string.