Towards a Theory of Cultural Evolution