StateCommandMap tests and command execution with dependency injection fix