Expect-like functionality based around io.ReadWrite interface