Better newline matching and file lines() method