Rewrite relations report - use csv lib, better escaping