Fix the return type of max() for number[]

This is an example fix for the typing of functions like max().  I only fixed max() but this impacts many many functions.  This fix pattern would be quite verbose if applied to all of the affected functions.

Alternatively, callers of these APIs could directly provide the type of the result but that forces the user of the definition file to do more work.