Reasonably efficient and concise exact longest common subsequence and minimum edit-distance algorithm implementation for JavaScript