Re-arrange reduction-related functions

This patch brings the reduction functions from both reduce.jl & abstractarray.jl together in reduce.jl. Methods of the same function are put together. This is a preparation for the efforts to clean up all these and ensure consistent implementation. (No changes except for moving stuff around were made at this point).
Merge pull request #5322 from lindahua/dh/reduce2

Rearrange reduction-related functions
Fix gradient function and add test
Fix #5324
Merge pull request #5325 from JuliaLang/sjk/n5324

Fix #5324
Merge pull request #5321 from JuliaLang/anj/fixgrad

Fix gradient function and add test
Fix #5326
better help text for equality and comparison functions
Merge branch 'master' of github.com:JuliaLang/julia
fix 11def4933cb20a504a76168f286497dba8dad459 typo
use < and <= for the partial order on Set and IntSet
Merge branch 'master' of github.com:JuliaLang/julia
better type inference for apply with unknown arguments. fixes #5327
fix #5319. predictably, type intersection.