Add unit tests for #fromJSONValue and #toJSONValue