Replace REGISTRY hash with a registry object
Extract constants from Emitter into Constants module
Make registry writer private