Refactor TransitiveLookupWriter for multi-threaded use