AMENDED AND RESTATED CONSOLIDATED LOAN AND SECURITY AGREEMENT AND MODIFICATION AGREEMENT