Incremental counter for jobs

And:
* bmod_storage: storage.replace() for CAS;
* bmod_state: state.add_previous() uses CAS of the event at saving;
* test for counted events flow.