         return context
     }()
     
-    public init(modelName: String, storeType: String = NSSQLiteStoreType, in directory: FileManager.SearchPathDirectory = .documentDirectory, wipeOnConflict: Bool = false) {
-        stack = LegacyCoreStack(modelName: modelName, type: storeType, in: directory, wipeOnConflict: wipeOnConflict)
+    public var managedObjectModel: NSManagedObjectModel {
+        set {
+            self.stack.managedObjectModel = newValue
+        }
+        get {
+            return self.stack.managedObjectModel
+        }
+    }
+    
+    public init(modelName: String, storeType: String = NSSQLiteStoreType, identifier: String = Bundle.main.bundleIdentifier!, in directory: FileManager.SearchPathDirectory = .documentDirectory, wipeOnConflict: Bool = false) {
+        stack = LegacyCoreStack(modelName: modelName, type: storeType, identifier: identifier, in: directory, wipeOnConflict: wipeOnConflict)
     }
     
     public func perform(wait: Bool = true, block: @escaping ContextClosure) {

    private var wipeDatabaseOnConflict = false
    private var pathToSQLiteFile: URL?
    private let mergePolicy: NSMergePolicyType
    
    private static var spawnedBackgroundCount = 0
    
    init(modelName: String, type: String = NSSQLiteStoreType, in directory: FileManager.SearchPathDirectory = .documentDirectory, mergePolicy: NSMergePolicyType = .mergeByPropertyObjectTrumpMergePolicyType, wipeOnConflict: Bool) {
        self.modelName = modelName
        self.storeType = type
        self.directory = directory
        self.mergePolicy = mergePolicy
        self.wipeDatabaseOnConflict = wipeOnConflict
    }
    
    fileprivate func performUsingWorker(closure: ((NSManagedObjectContext) -> ())) {

    public lazy var workingFilesDirectory: URL = {
        let urls = FileManager.default.urls(for: self.directory, in: .userDomainMask)
        let last = urls.last!
        let dbIdentifier = self.identifier + ".db"
        let dbFolder = last.appendingPathComponent(dbIdentifier)
        do {
            try FileManager.default.createDirectory(at: dbFolder, withIntermediateDirectories: true, attributes: nil)
