Extract DSL::{Guard, Registry} and put them to use

Makes it so the newly extracted mutable registry
is used in Chain::DSL and Dispatcher. This means
that both classes now share the same logic for
rejecting invalid objects in the registry.