Factor out _state_intervals to Ska.engarchive.utils