Add multithreading abstraction.
Update PDFDocument to use new multithreading abstraction.