improve dependency injection, Protobuf serialization, add YAML serialization