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