Add JavaScript edit distance

old work, to be committed