Added basic support for JSON messages.