allows max and min functions to work also in projections

The issue has been described in this thread https://groups.google.com/forum/?fromgroups=#!topic/orient-database/oi7gn1qRlIs

Functions max() and min() has been extended to support both:
* working on a projection
* working on a global result