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
Fix a discovery generation bug where fields that are types with illegal class names cause broken generated code.
moved common emitter methods into EmitterBase; defined EmitterContext and MarshallerEmitter interfaces
split JSON marshaller codegen from Protobuf; remove unnecessary marshallers in the JSON version
minor style fixes
Merge pull request #244 from yjbanov/marshaller-opt

minor code reorg; remove unnecessary JSON marshallers
move common request logic into a single parent class
Merge pull request #245 from yjbanov/request-send-method-code-size

move common request logic into a single parent class
fix freezing of nested lists
Merge pull request #246 from yjbanov/freeze-nested-lists

fix freezing of nested lists
remove unproven and confusing optimization in freezing logic
Merge pull request #247 from yjbanov/remove-speculative-opt

remove speculative optimization
fix benchmarks after breaking marshaller changes