Didn't Jefferson send the United States Navy to the barbary coast in the early 19th century to deal with the pirates and slave traders? I believe that the reference to the shores of Tripoli in the USMC anthem refers to that.