Two simplifications for streamcache.pipe
I have had to fix 2 bugs in 1 week in streamcache.pipe so I was taking a closer look at the code. I noticed a simplification that removes duplicate state. I also noticed during the review of one of the bugs that some functions that were meant to aid readability were having the opposite effect. So this change removes and inlines those functions.