Levenshtein distance in C, O(min(m, n)) space
Cython wrapper; went to C++ for the templates