Rewrote RpcManager

Messages are now formatted using json and
application/x-www-form-urlencoded.
Encapsulate MAS messages to a JSON container

Preparation for v2 of MAS REST protocol.
API upgrade, part 1
API upgrade, part 2

API is now fully JSON based
Refactoring the code. Added proper controller.