Large file support and simplifications to copy_stream.[ch]