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 
Another thing to think about here is possibly enhancing the "compression" for `CompoundPeriod` with certain `Period` conversions allowed. E.g. `Year(1) + Day(2) + Hour(24)` would become the `CompoundPeriod` `1 year, 3 days`. Not sure it's worth the extra complexity though. Maybe a `compress!()` function would be useful for that.