bugfixes in i/o: readlines needs to check for eof, and readinto should modify buffer rather than allocating a new one