Refactor TSV generation; now done in one pass.