Updated the main() function to write out lines of json serializable objects for each record. This skirts the issue of holding a huge list of json objects in memory.