Initial CoreData refactoring.