Class Structure and Social Improvement in St Andrews 1840-60