added func mainContext() to extension NSManagedObjectContext, added func createAsTemporary to extension NSManagedObject