minor tweaks to JSON writer file termination (always end in LF) and regtests