Fix check for script yuv matrix matching video yuv matrix
Preserve line current length in Duplicate and Shift

It's quite rare to actually want a multi-frame line followed by a
single-frame line; in most cases they're either all a single frame (in
which case this behaves the same as it always has), or they're all
multi-line, in which case this should be more convenient.
Change the selection before committing deletions of lines

For whatever reason this was sometimes being done after the commit,
which resulted in a lot of code only working by coincidence when the
grid commit handler happened to be the first one to be called.
More unique_ptr
Limit shift times history to the last 50 shifts