More refactoring of deviceManager.js, better device and interaction rediscovery handling, database connection error message