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
I'm reading #8946 and I'm not seeing how it's different to what is already implemented in ngAnimate, and what this PR implements --- `resolveElementClasses()` eliminates the no-op situations, is that not what we want?

I am happy to add the extra tests though, although it's basically an alternative version of the tests which are added here