Migration, membership regimes and social policies: a view from global history