Performance improvements for the UserLog CSV export. This version is
more than 15x faster than the previous one. It exports 127K+ records in
roughly 30 seconds now on www-dev.