Lift decision on which PlanType to use up to ExecutionPlan.run

This ensures that we use the same plan for both the profiled and normal case
Rename PlanType to ExecutionMode
Expose schemaStateFlush() from kernel
Test interaction of different execution modes with query caching
Merge pull request #3674 from boggle/lift-plan-type

Lift decision on which PlanType to use up to ExecutionPlan.run