Enhanced C implementation of Carbon relay, aggregator and rewriter