Move the json marshalling code to new module Rrd_protocol

Signed-off-by: John Else <john.else@citrix.com>