cdb: rework cdb-index and add cdb<->table