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
PlanTable uses QueryGraph instead of set of available symbols as keys
Split PlanTable into GreedyPlanTable for greedy planning and ExhaustivePlanTable for exhaustive planning

- using the new ExhaustivePlanTable in the exhaustive planning
Merge pull request #3674 from boggle/lift-plan-type

Lift decision on which PlanType to use up to ExecutionPlan.run
Merge pull request #3704 from davidegrohmann/dp-exhaust

Refactor PlanTable
Add query logging.

Three new options added
- log_queries, if true log queries, defaults to false
- log_queries_filename, the file where queries are logged, defaults to `queries.log`
- log_queries_threshold, only log queries that run slower than threshold (in milliseconds)
  defaults to 0, i.e. log all queries.

 This is an enterprise feature.