WIP: Refactor certificate agent and queue

Details to follow...
I think I'm misinterpretting either your comment or the code.

Isn't this what's happening, only sleeping when the queue is empty?