Build tools: implement the run operations

And adds a str_replace() utils function.