Optimize unique name manager.

State is not managed implicite by nextEvent method. Number of events is
given by instantiation.
Test updates.