Extracted escapeSort for String, Sort and NonTerminal. Fixed some more of Dwight's comments.