Improves the speed of units.

- Reduces unnecessary calls to sort that were used to create unique ids.  It's faster to keep the powers and bases sorted in a canonical way all the time and then not have to re-sort on a regular basis.

- Memoize the _compose method by the unit -- this results in about 50% cache hits.

- Reduce the use of `Fraction` in calculations by converting Fractions with a power of 2 denominator.  `Fraction` instances are still used for other rationals that cannot be represented exactly by a floating point number.
Clarify and fix logic about converting powers to floats
Merge pull request #1289 from mdboom/unit/speed_optimizations

Improves the speed of units