accumulate exercise

Added accumulate exercise. This time, I found it easier to not put the test cases in json, too many inline subroutines. I hope this is ok.