Refactor emitter registry to use a class variable

@solnic wdyt?

Normally I wouldn't use class variables for much, except this is precisely the use case they were designed for (share state between classes in the same hierarchy).

Also, I wanted to hide the fact there is a registry from the public interface, and added an Emitter.finalize method that is responsible for finalizing the registry.