Ported diff_ex() to XS