Enum counter rename

COUNT is a too generic for the enum counter.
If another enum use the same name, a compilation error will occur saying
that it is redefined elsewhere.
The good solution seems to be wrapping enums in their own namespace, but
this involves a lot of refactoring.