More work on readline() and friends
Update tests