refactor($animate): clean up core $animate code