Performance improvements. Write to disk more often in export so that less is held in memory.
Export python dictionaries and properly handle exceptions for exporting.