Clone factoryDefinition on `createStore`

This fixes store state leaking between multiple instances of a store.