juju-run: code cleanup, doc cleanup, adding tests