add reduce (foldLeft) implementation.
add countBy.
Merge pull request #5 from qianyan/master

add reduce