Dynamic counters

Added the concept of "dynamic"counters - counters whose name is defined within instrumented code and be related to the current state.

Not sure if this is the best solution, but can't think of a better one right now - feel free to suggest
this is much less clear to read than a switch statement.