Give PerfTimer the ability to write only slow operations to the log

This is useful to ignore fast operations that just spam the log.

The class had to be reworked because it couldn't properly handle cases
where all of a node's children where below the threshold.

Also changed DoTimed() and RunActivity() to use PerfTimer.
Preload sequences and fix #5382
Merge pull request #5389 from pavlos256/preload-sequences

Preload sequences