Modeling Society with Statistical Mechanics: an Application to Cultural Contact and Immigration