Flatten / Un-flatten JSON objects