Slight refactoring in PbrtToCsv to make testable