[FIX] Porting gustaf to new stream module.

Work not complete, some app tests still fail.
All these catches could become one catch and a variable that you increase after each writeRecord.