Removal of device code from libadm; associated cleanups.