Added YAML-serialization and tests for it