Storing objects in a flat file as JSON