Factored out JSON encoding/decoding for iRODS wrappers