Count lines starting with # in CSV header, and using it for skipLines; some code cleanup