Reworked the output of the planner

Reworked the output of the planner so that the primitives can be
executed by an actor, rather than the primitives being a list of
strings.
Changed the planner trace functionality to allow a trace object to be
passed into the plan search instead of using a global.