Issue #4 use a stats library for calculations and move them into metric responsibility.