Overhauled library management, implementing recursive library checking