Add sum function and it's corresponding documentation and test cases.