Implement standard precedence for boolean operators, not just left-to-ri...

There were several problems here:

1) The code actually implemented simple left-to-right precedence, whether AND or OR. This PR fixes that

2) The test states "give precedence to AND", but the examples and comment actually gave higher precedence to OR

3) The standard precedence for algebraic logic is for AND to have higher precedence (gets evaluated first, like multiplication).

This PR implements the standard precedence and tests for it.