WIP: Refactor certificate agent and queue

Details to follow...
Reminder about the dummyN convention. :)