added exception handling in planning

Will shutdown when there's an exception, hopefully preserving state for
world and best-plan.  Also print exceptions and states to console.