Disable flow style for YAML output
Make YAML output for context serialization a full yaml document
Introduce simple API for better modularity and reuse