fixed bug in stream model where forEach was used instead of map.  Also added some optimisations
Merge pull request #220 from Financial-Times/error-47086707

fixed bug in stream model where forEach was used instead of map.