Swapping out IO#readline implementation

with something that is still incomplete, but doesn't incorrectly rely
on IO#each_line.