RPC library using promises and socket.io