From http://stackoverflow.com/questions/13167808/angularjs-csv-download-to-local