Refactored out singleton usage of managedObjectContext.