Moved things into flowlib

So I managed to create a parse function which takes either a PackedState or a State (wrapped as GenState) -- you can see now flows or packed_flow call a common library to do their thing.  Phew.

Packed flows aren't yet fully implemented though.