Constructing general models of theory dynamics