protobuf is now an option
fixed some bugs in writer and finalzed json bit