Move read_sequence and write_sequence from s->s3 to s->rlayer