Refactored DistributedThread tests.