Added n-ary operations. Fixes #1.