fix($animate): ensure animations work with directives that share a transclusion

Closes #4716
Closes #4871
Closes #5021
Closes #5278