TERM LOAN, SECURITY AND GUARANTY AGREEMENT