Add device update operation rather than just metadata update. Improve
unit test for devices.