Refactored CoreData code. Other fixes.
Deleted unused DBController.
Refactored imports.