Make Producer covariant
Move the Planner code into core
Fixup tests
Fix imports