Implement 'dirty bit' logic

Also do some other changes important for this---see the commit messages for the first two commits
Good point.  (I really wish nullable defaulted to False. I'm used to pure languages.)  In that vein, there might be a couple of other fields that shouldn't be nullable---perhaps label and id, for instance.