Fixed aggregateCumulative + added tests

Addresses #11

Also minor linting