I used a global to control json-serialize's interpretation of lists, but
it could be an argument as well.
Please don't add global state to json.c. It's a low-level library that shouldn't rely on global state (and global state should generally be avoided in libraries). Not having global state was one of my explicit design goals for json.c