Factorize code in selectAllLevels() (IndexedDB.js)