Add sync and redefine read/write api

Instead of defining 'chans' on the stateDescriptor, now define 'io'
which readers and writers which should be functions returning channels