split generator into libraries

this is in preparation for splitting the discovery logic from protobuf
logic in the emitter, which will allow tighter optimizations for each
wire format
separate discovery parser from protobuf parser
Emitter becomes Emitter/EmitterContext; emitter, template_loader are separate libs
reduce boilerplate in emitter by making global values fields on EmitterContext
Merge pull request #241 from yjbanov/marshaller-opt

Organize generator code into libraries to support experimentation with custom marshallers