Moved the csv and StringIO imports to the beginning of the module