Add caching of leptonica and tesseract