CLA-570 Move registration methods into Registry class. Add and improve tests