Add spec for leaking state
Fix state leaking between multiple instances of a store

This fixes the issue by creating a clone of the `factoryDefinition`
in the `Store` constructor.