Extract out parsing proto file logic from ProtobufGen

this should have .format(prev=prev, curr=path) at the end of the triple-quoted string.