Refactor sum functions

Now `sum(x)`, `sum(f, x)`, `sumabs(x)`, and `sumabs2(x)` use the same core algorithms. The function `sumabs` will be used to implement `vecnorm1`, and `sumabs2` will be used to implement `var`.
New sumabs2 to replace the original one in statistics.jl
add tests for sumabs and sumabs2
Merge pull request #7017 from lindahua/dh/sum3

Refactoring sum functions