Added a feature that keeps track of every note's index. So if a note is deleted, then undo is clicked, it goes back to where it was, instead at the end of the list.
More clean up.