Only invoke mocha once per stream

This pull request will only invoke mocha once per stream, leading to much faster build times.

I also updated the code to use a Transform stream as it seemed to more closely represent what was happening with the Duplex stream.