added support to Duplex streams.
increased tests readability and accuracy.