Moved serialization to core and fixed indexeddb