Improve JSON parsing and generation.