Add Counter class and tests