Added delimeter argument to the toCSV() function so that an optional delimeter other than a comma can be used