WIP: Refactor certificate agent and queue

Details to follow...
You might as well give this thing a shebang line and the
```# -*- coding: utf-8 -*-```
statement