JavaScript module that does basic math on arrays