fix($animate): ensure that class-based animations only consider the most recent DOM operations

Prior to this fix $animate would maintain a count of each time a class was
added and removed within $animate. With this fix, $animate instead only cares
about the most recent class times that the classes were added and/or removed
and it will only remember a total of one addClass or removeClass operation per
className.

```pre
// before
addClass    => +1
removeClass => 0
addClass    => +1
addClass    => +2
removeClass => +1
// this will cause an addClass animation

// now
addClass    => +1
removeClass => 0
addClass    => +1
addClass    => +1
removeClass => 0
// this will cause no animation to run
```

Closes #8946