Make ActiveRecordModel.(not_)in_state work with initial states (BREAKING CHANGE)

Annoyingly this means all implementations of  `ActiveRecordModel` need to add a `initial_state` class method, so that initial state can be detected.

@greysteil could you take an initial sanity-check? The SQL is getting pretty skanky now.