this works a lot better than the very bad dump function I had before.
The output isn't pretty printed but can easily be made so by piping it
to jq, for example.
handroll some libyaml bindings.
I was originally going to use yaml-cpp, but C++ sucks tremendously and
looking at the libyaml documentation, the event-based parser API
probably works the way I want it to so let's try it out.