Check leaf nodes are still in dom on line rebuild

Fixes #88
Choose delta with fewest insertions, fixes #98

When trying to pick a delta describing document change. Previously used
delta with fewest operations.