update cmdmod integration tests
update cmdmod state calls
split _run cmd
Merge pull request #19238 from jfindlay/ensure_cmd

update cmd state and module integration tests