Fix broken network device references on upgrade.
Moved methods from NetworkDevice model to DeviceManager class.