Adds a unit test showing that changing the id on a polymorphic record fails.
Fixes polymorphic records so that you can change the id on the record.  Previously, this would result in broken storeKey caches on the polymorphic superclasses, so the same record would appear with different ids depending on which class it is requested with.
Tidies whitespace.