RPCHandler::doCommand becomes free function