to be able to specify one's own JSON converter

if not specified, use the default `RJSONIO::toJSON()`

This PR should not break existing widgets packages, and frees the package authors from RJSONIO (if they want). Once we have got this capability, the priority of #28 will be low.