Encapsulate MAS messages to a JSON container

Preparation for v2 of MAS REST protocol.