Use a DURATION parser when reading the 'query time to live' from the settings

- make sure that the queryPlanTTL is read before the creation of the compilers and injected when needed to avoid
  single components to read the configuration.
Inject a Clock instead of creating manually Dates for retrieving time in plan fingerprint
Check txId on the candidate stale plan after having check the timestamp

- better code for accessing the last tx id
Inject statistics divergence threshold into the ExecutionPlanBuilder
Merge pull request #3530 from davidegrohmann/2.2-replan-ref

Refactor of replanning code