Type sig formatting
Iterate over initialised state, not entities/sources

Recast existing "loop over all the sources and X" loop-y code to
instead operate over the collection of initialised states. This, if
nothing else, removes the code to lookup state values, which looked
(and probably was) quite unsafe.