feat($animate): proper support for multiple elements

Run performAnimation for each node instead of doing it for the first
element node.

I made this PR keeping in mind to make as little changes in animate.js and as quickly as possible to get across my point. The code can be more elegant (e.g. introduce another function, etc.).

Fixes #4954 , relates to #5561 and #4786 .