Make Counters stage-aware.

There's a new Scope, PipelineScope, that lets counters
survive for only one mapping phase.