MASTER AMENDED AND RESTATED CREDIT AGREEMENT