A simple streaming JSON encoder.