Remove 'maxBy' and 'minBy' and replace defs of 'max' and 'min' with them