Use Perl IO to read data files and use smaller chunks (fixes #10)