JSON-RPC based messaging and presence protocol