Separate the json generating bit from browse.c.