improved regex for matching delimiter, newline and enclosures, stripping extra spaces before and after delimiter when not in enclosures, make str_getcsv delimiter and enclosure agnostic, plus other bits of refactoring/simplification