refactored CoreData implementation
implemented methods to fetch, insert and delete entities.