Applications of search and matching to international trade and unemployment insurance