trackchanges: move code into a separate extension (part 2)