Reimplement readlines()