Flatten nested JSON to dot-notation keys and back
Flatten converts nested objects to dot-notation keys. Unflatten reverses it. Arrays are left as-is.