pkg: split out PeriodicReconciler from agent/engine, add tests