Rewrite the program and drop support to libevent 1.x.