Better element transposition identification

Add translate-id/remarkup-id attributes for better
element identification, tune distance function to
better match transposed elements