added TypedThread and CallbackThread
made StubThread a subclass of TypedThread