fix bug that prevented escaping of quotes in dirty strings when preceeded by an even number of forward slashes
shuffle some string clauses for slightly better performance