split AbstractMeansure

Remove out inner class in AbstractMeasure to get more readable, and make these classes testable.