updated rakefile. migrating coredata logic to the model.