Add registry that can be used, e.g., for callbacks

Add test testing the registry with two different element types, and two
different container types.