improve performance of product_limitedlen()
add new per-typo-type --max-typos-... options

also unit tests for new options;
minor other bug fixes, optimizations, and doc changes