re-introduce Counter.hs using GenProcess; rework the APIs a little