added config options for min/max_density
optimizing get_tesseract_languages
check for valid language parameter, fixes