ENH: ignoring comment lines and empty lines in CSV files

closes #2685 
closes #4466 

Actually, is there a good way to separate this? The test will fail without the changes in this PR, because this PR causes a `StopIteration` to be raised for empty data.