moved mean() to utils.js
Fixes #25