LCS algorithm

After pseudo-code in
Lecture notes by David Eppstein,

commonSubseqs: find common subsequences
  a, b: two sequences
  l: list of common subsequences
  m: the length of a
  n: the length of b

longestCommonSubseq: find the LCS of two sequences
The sequence type must have an __append metamethod. This is
provided by string_ext for strings, and by list for lists.
  a, b: two sequences
  s: an empty sequence of the same type
  s_: the LCS of a and b