Minor: refactoring
Fixed issue #2387. Implemented filter optimizer.
Fixed issue #2387. Refactoring and remove old optimiser
Merge branch 'orientdb-2387-date-conditions' into 1.7.4