Clean up line change tracker and add undo line unit tests