JSON and TSV support, further cleanups