Re-factoring code to use node.js new Streams2

Old code got broken due to Streams2 update (plus some internal bugs)