Moved threading behavior behind a virtual interface. Client is now a smart pointer.