Refactor the animation system to make overlapping animations work properly