parse quoted strings, and clean up a little