New code loops much less, does re-open & close .blend files for each data type, and is much much more flexible - it is also ready for id-remap & co work being done in branches. Main idea is to store libraries & datablocks to link in a dedicated struct, in a way that avoids too much looping, and also allows to search for a single datablock in several libraries. Here again, no change is expected in current behavior of link/append tool, please report if anything goes different!