Add includes for algorithm.

Fixed compile errors for "error C2039: 'max' : is not a member of 'std'" with Visual Studio 2013 (and perhaps others).