Add missing <algorithm> include for std::min & std::max
Add missing <functional> include for std::greater
Add <algorithm> includes and use min/max to get them into global scope
Merge pull request #386 from ace13/develop

Missing includes.