[#2] Add json serializer

You can serialize attributes by #as_json or #to_json. In this way you
can in simple way pass attributes to services objects.

Fixes #2