Add merge frontend and tests

Signed-off-by: Yury Tsarev <ytsarev@suse.com>