Fixes a critical bug in polymorphic record support while significantly improving performance and reducing memory consumption of polymorphic records.

The previous polymorphic record support took care to ensure that the same store key was returned for all polymorphic classes by duplicating the store key to id mapping on each related polymorphic class. But where it failed was in situations where the store manipulated the store keys hashes directly (ex. replaceIdFor()), which would result in different store key to id mappings between polymorphic classes. Also, duplicating the mapping on each class was very wasteful and slow due to recursion. Instead, now the mapping is stored only once on the root polymorphic record and all subclasses simply reference it directly. This removes the duplicate memory use and removes the need to recurse each time that a new polymorphic record is added to the store.