Ban d3.max and d3.min across the project. Close #843

Close #843.
New version of #879 

Is it possible to go with this possible second signature or no?
export function max<T>(arr: T[], acc: (x: T) => number, default_val: number): number;

Reason being is that if we go with this, then the usage throughout the code that relies on default_val being 0 would be really clean.  This relies on the comment right above going through though.