Remove unused Data and Typeable derivations.
Use mass as a tiebreaker for sorting shapes.