change sed code to use the new local state feature
add withState varieties of various "run" commands; add locking behavior for command dispatch to optionally prevent concurrent execution of commands; add a Command structure that gets passed to addComamnd to specify configuration