elementary transformation to JSON of strings, boxed primitives and basic objects