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.

```
// before
addClass    => 1
removeClass => 0
addClass    => 1
addClass    => 2
addClass    => 3
removeClass => 2
removeClass => 1
// since 1 > 0 then this will cause an addClass animation

// now
addClass    => 1
removeClass => 0
addClass    => 1
addClass    => 1
addClass    => 1
removeClass => 0
removeClass => -1
// since 1 < 0 then this will cause an removeClass animation
```

Closes #8946
Based on what you've commented, the snippet below doesn't involve the addClas/removeClass operation cancelling itself out right? Have a closer look.

```js
$animate.addClass(element, 'two');
$animate.addClass(element, 'two');
$animate.removeClass(element, 'two');
$rootScope.$digest();
$animate.triggerReflow();
expect(log.length).toBe(0);
$animate.triggerCallbacks();
```

The usecase here is that if one directive (such as ngClass) performs an addClass operation and then a removeClass operation within the same digest then there is no point in running an animation.