Various JSON structure and code cleanups