Ensure that recording output directories exist
Remove the trust anchor state
Use class of original query for findkey phase
Remove dead code
Remove remaining event leftovers
Cleanup formatting