Use system line separator

Use system line separator when writing shards of json rows.

Add more test coverage.