Made discover-gadgets periodically dump and reload the library.

Maybe this will have an effect on memory usage? Who knows!?