Move cluster endpoint/jsonrpc functionality into libremote.

Refs #5690
Refs #5636