Migrate a few classes to a new threaded framework.
A few fixes requested by @deguio (DQM MT migration).
Merge pull request #6044 from dmitrijus/mtmigrationa

Migrate a few classes to a new threaded DQM framework.