implement isDirty with per-slice tracking

Basic tests are in place.