Add sum() function

Fixes #49.
Merge branch 'func-sum' into develop

* func-sum:
  Add sum() function