RF: refactor remove_similar_vertices

Rename some variables, refactor return variable logic, add comments.

Logic almost the same, except for raising error for vertices list of
exactly length 2**16 instead of > length 2**16.