Fix state.sls_id

This resolves three issues:

1. outputter not properly specified for this function
2. multiple state declarations under the same ID declaration are not
  reflected in the output
3. traceback occurs when ID is not found in the specified mods

Fixes #17017