allow additional options to be passed to the JSON backend

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