pmctl: support a control CLI (WIP)

WIP, please don't bother to review yet.
The convention so far seems to be for this code to go somewhere in lib/ and for bin/sl-pmctl.js to be a stub that exposes it as a CLI command.