Add dirty state helpers (state.js)