Impproving the DAO layer, DeviceManagerService SPIs and implmenting initial bits of plugin management
fixing merge conflicts
code cleanup