Refactored the animation codes.

I use callback instead of $timeout to make a move when the animation
completes now. (I checked the wrong version of the docs before… No
wonder promise won’t work… Currently I’m using the v1.2.23. Yet the
implementation will changed in the future versions.)