hasPrecedence method in LuceneExpression interface.

Introduced, implemented and tested hasPrecedence method on all implementations of
LuceneExpression interface. The method is now used to compute the necessity of wrapping
a realized expression with parenthesis.