Implemented scanl, scanr, scanl1, scanr1 reductions. (fix #2)