fix various csv bugs

* use unicodecsv library
* check the magic type of the file and flash error message if it is not
  dected as csv
* flash error message if pandas fails to parse the file