Modified YAML parser to use pyyaml library. More robust and less code.