general: various cleanups
run: add support for executing commands remotely via SSH or in a container

Also, unify the transport logic a bit, since we reuse the same scheme in
many of our client tools.