refactor rserve.js out of rclient.js