rank_visit_count: refactor for easy CSV output.