Generalized selector and sequences

- Enabled nesting of selectors and sequences