         }
     }
 
+
     public func cleanupPlots(completionHandler: ((Void) -> Void)? = nil) -> Void {
-        let childContext = NSManagedObjectContext(concurrencyType: NSManagedObjectContextConcurrencyType.PrivateQueueConcurrencyType)
+
+        let childContext = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
         childContext.parentContext = managedObjectContext
         childContext.mergePolicy = NSRollbackMergePolicy;
         childContext.undoManager = nil

        }

        dispatch_once(&Static.onceToken) {
            Static.instance = self()
        }

        return Static.instance!
    }

    public required init() {

        NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("mainManagedObjectContextDidSave:"), name: NSManagedObjectContextDidSaveNotification, object: managedObjectContext)
    }


    func mainManagedObjectContextDidSave(notification: NSNotification) -> Void {
        DLOG("Saving MOC based on notification")
        managedObjectContext?.mergeChangesFromContextDidSaveNotification(notification)
    }


    public func saveContext () {
        if let moc = self.managedObjectContext where moc.hasChanges {
            do {
                try moc.save()
            } catch let error as NSError {
                NSLog("Unresolved error \(error), \(error.userInfo)")
                abort()

        }
    }


    var dateFormatter: NSDateFormatter {
        if let actdate = _dateFormatter {
            return actdate
        }

        _dateFormatter = NSDateFormatter()
        _dateFormatter!.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZ"
        _dateFormatter!.timeZone = NSTimeZone(name: "UTC")
        return _dateFormatter!
    }
    var _dateFormatter: NSDateFormatter? = nil


    public func dateFromString(string: String) -> NSDate!
    {
