Refactor animation, plus test

Change-Id: I688c573b7fbd136782177f0b690d3aab994c6d10
Merge "Refactor animation, plus test"