Add indices to state group tables
Document StateStore and use transactions