Completed port to io-streams, except for some convenience combinators