various simplifications and tidying up in weave script

The only (internal) semantic change is that with_container_ns now a) takes the container as the first arg rather than the second, and b) invokes the command as given, i.e. the container is not passed to the command.

The remaining changes are refactors for simplicity, consistency and clarity.