initial commit of stream implementation in javascript