Define operator precedence

This solves all shift/reduce conflicts.
Add tests for the ^ operator