What foreign entanglements and questions of foreign policy did jefferson have to deal with during his presidency? how did these issues affect his political philosophy?