Two fixes:
* The find-doubles operator was overriding the "dirty" element
indices, so vertices were not being mapped correctly.
* In some cases a vertex can be set to merge with a vertex that is
also set to be merged, so added a loop to find the first unmerged
vert in this case.
Not yet working is the "First Last" merge option.
Also made some cleanups and added comments in the array/remove doubles
code.
Now create the rotate edge in advance and copy its customdata (before joining the faces).
This commit also fixes an annoyance where tryangulating faces could create duplicate edges.
* change BMO_elem_flag_* defines to inline functions.
* BMO_slot_map_insert() is too big for an inline function - un-inline it.
* remove redundant casts.
* added BM_elem_flag_set, BMO_elem_flag_set. to avoid 'if(...) enable(); else disable();' all over the place.
* added bmesh_operator_api_inline.c, the header file was getting messy.