db-test: move functionality to libdb
midiogre: cleanup