switch JSON backend from JSON.pm to JSON::MaybeXS

This change also fixes the lack of utf8 support in encoding by using the
encode_json interface, which uses utf8 => 1.

JSON.pm only supports JSON::PP and JSON::XS, whereas there is another very
popular backend now, Cpanel::JSON::XS.
allow additional options to be passed to the JSON backend

This builds on top of #2 to allow customizing the behaviour of the JSON
serializer - e.g. changing the options for utf8, ascii, pretty, allow_nonref,
etc.