Improve YAML parse time.

Stream lines to avoid needing to load the whole file first, and avoid a LINQ Contains call when string.IndexOf will be much faster.
Merge pull request #7232 from RoosterDragon/yaml-parse-perf

Improve YAML parse time.