Fix SQL2 operator precedence

Fixes phpcr/phpcr-utils#12. This uses the operator precedence climbing algorithm proposed by @fabpot. I have also added some tests to phpcr/phpcr-api-tests in a separate pull request.