Added program for writing directly to a mysql database. Improved filter and curation for both writing to csv and to database.