Fleshing out the grammar: added a root rule and allowed for nesting between sequences and chains