Fixed new dialogs not closing.
Started to implement changes to sorting.

Haven't got the loop or the edge deletion in yet, but everything else is
there, I think.