[FIX] Porting gustaf to new stream module.

Work not complete, some app tests still fail.
I'm trying to keep it as closely to the original as possible since Kathrin's actively working on Gustaf AFAIK. I'll explain to her how to do this.