Improved file reading; should no longer choke on huge files