Refactor TaskMonitor, test NameServer.