SERVER-12153 SERVER-12171 Refactor CanonicalQuery::isValid()

Add unit test accordingly.
SERVER-12153 SERVER-12171 Restrict valid query expressions with $text

CanonicalQuery now refuses to canonicalize queries that contain
either:
- >1 $text clause
- $text inside a $nor clause
SERVER-12277 CanonicalQuery forbids queries with both $text and $near