Add XCES support and client/server mode