Add a `leave` command and RPC endpoint

Fixes #82. Allows for clients to control the leave behavior.