Refactor for #161 - added count, sum, mean, var, stdev