Simple implementations of file.readline(), map()