Reorganize mem store. Add clear() for resource events