Rewrote CSVtoJSON func to play nicely with PHP 5.5