Introduce an exhaustive planner

Still work in progress - not used by default yet.