implement YAML marshaling

This will make it possible to generate charms programmatically.
Would be nice to have a comment for this function