Code now more modular, using tempfile

Code was made modular, since parsing will soon be done on ocr results.
The only exception to tempfile is pdfimages.exe, since it spits out a
bunch of image files at once.