Bug 1037658 - Move csv helper functions to a higher scope