move serialization methods into vg function
move serialization methods into vg function

Abstraction lost, but performance gained. This could also be solved by
providing the method in stream.h with an iterator. Crucially, this allows us to
an extra copy of the graph.

ekg/vg,dnanexus-rnd/vg,abeconnelly/vg,dnanexus-rnd/vg,abeconnelly/vg,ekg/vg,ekg/vg