implement YAML marshaling

This will make it possible to generate charms programmatically.
would be nice to make the marshalling explicit, I think