fix writer to generate more compact json
add ReadNextValue