AMENDED AND RESTATED LOAN AGREEMENT (Line of Credit and Term Loan)