Add -c option to specify client, and move detach/refresh to client rather than session.

37 files changed