Refactoring: rename thinkInternal to thinkPlan, and return Plan.

This is mainly for "interactive".