[FLINK-1020] Introduce minBy and maxBy

This closes #101