Build tools: implement the run operations (not finished)

And adds a str_replace() utils function.