getComputedAnimationDuration now returns a function in order to get the correct animation duration and added a test to check that loadEnd is called at the correct time