Improve qb validation

fixes some bugs in the tests, also fixes https://github.com/doctrine/phpcr-odm/issues/541

note ``Doctrine\Tests\ODM\PHPCR\Query\Builder\BuilderConverterPhpcrTest::testOrderBy`` is failing .. but honestly I don't really think such a test makes sense. It is way too complex to test as it requires so much mocking. IMHO we are better off testing this via the various existing functional test. So I vote for removing that test.

/cc @dantleech 

```
lsmith@localhost cmf-sandbox (1.2)$ app/console doctrine:phpcr:workspace:query "SELECT * FROM [nt:unstructured] AS a WHERE CONTAINS(a.title, 'cmf')"
Executing, language: JCR-SQL2
Results:

0.01 seconds
lsmith@localhost cmf-sandbox (1.2)$ app/console doctrine:phpcr:workspace:query "SELECT * FROM [nt:unstructured] AS a ORDER BY CONTAINS(a.title, 'cmf')"
Executing, language: JCR-SQL2



  [PHPCR\Query\InvalidQueryException]
  HTTP 400: Query:
  SELECT * FROM [nt:unstructured] AS a ORDER BY CONTAINS(a(*).title, 'cmf'); expected: LENGTH, NAME, LOCALNAME, SCORE, LO
  WER, UPPER, or CAST



doctrine:phpcr:workspace:query [-l|--language[="..."]] [--limit[="..."]] [--offset[="..."]] [--session[="..."]] query
```