small optimizer improvements to tupleref_elim_pass and effect_free

improved versions of some tuple functions