Refactored IOHandler, PDFHandler, improved test