Improve lseq implementation.

Use SortedSet rather than Ruby array.