Added counters into analysis package.

Adjusted tests a bit, wrote some new ones.