Added quote and comment support to parser
Changed high-level function logic a bit