A Model of Social Identity with an Application to Political Economy: Nation, Class, and Redistribution