Refactor engine reconciler and add tests!

Sure