Feature/protobuf output

Adds a protobuf descriptor and supersedes #1161.