rgw: introduce decode_json to easily decode json structures

Introducing a new way to define the json structure of an
object, similar to what we do with bufferlist encode/decode.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: decode RGWUserInfo using decode_json

RGWUserInfo can be decoded using json_decode, and fix
the ->dump() method to match that decoding.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: rgw_jsonparser changes

Now testing json_decode functionality.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
moved rgw/rgw_json.* common/ceph_json.*

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: add encode_json

dump() just dumps the internal content of an object, encode_json()
create the object inside its own section. Note that there are cases
where we don't want an object to be surrounded by a section, e.g.,
when an object represents an array. In such a case we'd need to
override the encode_json() for this object type.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>