cmA*Command: Turn into free functions

Ref: #19499
25 files changed