Moving Core Data code into singleton class