Add test for attach frame encoding
Fix attach & flow encoding tests, and bugs found during testing.
Add test for transfer frame encoding, some fixes.  Still need message object etc.