Clone of https://code.google.com/p/yaml-cpp/ (with minor changes)