fix #9214: canonicalize CompoundPeriod

As discussed in #9214, this canonicalizes the `CompoundPeriod` type to merge periods of the same type, e.g. `(Dates.Second(2) + Dates.Millisecond(7)) + Dates.Millisecond(1)` now gives `2 seconds, 8 milliseconds`, and to eliminate zero periods.  This is needed to make addition of compound periods associative.

It also cleans up a couple of other problems identified in #9214: `CompoundPeriod` is now an `AbstractTime` subtype (like `Period`), addition/subtraction is no longer mutating, missing `+` and `-` methods for two `CompoundPeriod`s were added (as required for associativity), and `==` is no longer object equality.

cc: @quinnj