Fix TimedItem._parentToGlobalTime() to use DEFAULT_GROUP.itemTime

Currently this method uses DEFAULT_GROUP.currentTime, but this is always zero
due to bug https://github.com/web-animations/web-animations-js/issues/66. This
bug probably won't get fixed, as the switch to TimeSources is imminent.

As a work-around, this change fixes TimedItem._parentToGlobalTime() to use
DEFAULT_GROUP.itemTime, which is equivalent.
Rename updateIterationDuration() to _updateInternalState()

This is a more appropriate name now that all duration calculations are done
lazily, Also remove a couple of stale comments.
Calculate TimedItem.endTime lazily

When the timing properties of a TimedItem in a hierarchy are modified, the
endTime must be updated before the parent is updated (in the case of a parallel
parent), but the endTime may also be affected by that update to the parent (in
the case of a sequence parent). To avoid this complexity, we calculate the
endTime lazily in the property getter.

This will also allow us to reduce the number of calls to updateTimeMarkers when
the timing properties of a TimedItem in a hierarchy are modified.
Avoid superfluous calls to updateTimeMarkers() when a TimedItem is modified

This patch eliminates superfluous calls to updateTimeMArkers() from both
_childrenStateModified() and _updateChildStartTimes().

This should improve performance, as well as simplifying debugging.
Make TimedItem.reparent() 'package private'
Fix reparenting when setting TimedItem.parentGroup

Makes sure that we update both the previous and new parents when assigning to
TimedItem.parentGroup. Also adds a number of tests concerned with reparenting.
Take a copy of the array of children before creating an AnimationGroup

This avoids bugs due to the array being modified as a result of creating the
AnimationGroup. See
https://github.com/web-animations/web-animations-js/issues/65 for details.

Also add checks to make sure a TimedItem never sets itself as its parent.
Fix handling circular references in ancestry chain

We should never end up with circular references in the ancestry chain. Fix this
by checking for an ancestor when adding children in AnimationGroup.splice(). If
a new child is also an ancestor, we remove it from the ancestor chain before
adding it as a child.
Add a test for calling AnimationGroup.add() with an existing child
Remove AnimationGroup.getActiveAnimations()

Remove unused AnimationGroup.getActiveAnimations()

This was added as a stub in 0f337947 and implemented in 31218c11. However, it
was never called, other than by itself.

Animation._getActiveAnimations() and AnimationGroup._getActiveAnimations() were
introduced in 629b270e and these are used by DEFAULT_GROUP.
Add TimedItem.clone()

This is required by the current version of the spec and will be required to
support TimedItem.attach() (part of the TimeSources implementation) in the case
that the TimedItem is already attached.
Rename TimedItem._getActiveAnimations() to _getItemsInEffect()

This method gets all TimedItems which are currently in effect. This is a
superset of the TimedItems in their active interval, as a TimedItem can have an
effect outside its active interval due to fill.

Also add a stub implementation of this method to TimedItem, since
AnimationGroup._getItemsInEffect() calls _getItemsInEffect() on its children,
which are of type TimedItem.
Rename TimedItem.updateTimeMarkers() to _updateTimeMarkers()