Essays on migration, inequality and sovereign default