JsonEncoder now wraps an output stream, this allows for more control
over writes (especially from projections).