Extract out parsing proto file logic from ProtobufGen

same as previous comment