Improved database and linkbase compaction. Updated unused linkbase checker code.