Local counter scopeless implementation and serialization.

Counters are shallow-serializable. 
Added test to specify this behavior.