fix(ngAnimate): defer DOM operations for changing classes to postDigest

When ngAnimate is used, it will defer changes to classes until postDigest.
Previously, AngularJS (when ngAnimate is not loaded) would always immediately
perform these DOM operations.

Now, even when the ngAnimate module is not used, if $rootScope is in the midst
of a digest, class manipulation is deferred. This helps reduce jank in
browsers such as IE11.

/CC @tbosch --- alternative/more general fix here

Closes #8234
Closes #9263
@caitp: @matsko put together this gist: https://gist.github.com/matsko/1aad4264acf320fca1b4

that looks like the right thing to me even though it means that if you use $animate outside of digest then the class changes won't get flushed until an unrelated digest happens. We can't think of legitimate cases when $animate should be used outside of digest.

if we cared about the out-of-digest use-case then we could either do this sync dom manipulation or use some sort of microtask queue to flush the css classes, but since we don't have a need for it we don't need to worry about it.

if there are any pre-existing tests that use $animate outside of digest, they should be changed.

sounds good?