Added ThreadSingleton class and tests. Need to compile and verify they work.