Update Tesseract Code
The tesseract module contains a lot of deprecated code as well as code
meant for ideas which have never been realized and only complicate and
slow down the module.
This patch updated the old code, replaces deprecated methods and cleans
up unused code while keeping the same functionality.