Rewrite using monadic futures & streams.

--HG--
extra : amend_source : fe9b6b47a0e49a6b7439cba156a2073d61a32846