trackchanges: move code into a separate extension

(integrated from trunk branch change d861535 by Todd Whiteman <toddw@activestate.com>)