         return false
     }
     
-    private func databaseFilePath() -> URL? {
+    fileprivate var databaseFilePath: URL? {
         if let existing = pathToSQLiteFile {
             return existing
         } else if self.storeType == NSSQLiteStoreType {


private protocol CoreStack {
    var mainContext: NSManagedObjectContext! { get }
    func performUsingWorker(closure: ((NSManagedObjectContext) -> ()))
}

@available(iOS 10, *)
@available(tvOS 10.0, *)
private class CoreDataStack: CoreStack {
    private let modelName: String!
    private lazy var container: NSPersistentContainer = {
        let container = NSPersistentContainer(name: self.modelName)

    
    lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = {
        let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
        let url = self.databaseFilePath
        
        Logging.log("Using DB file at \(url)")
        
