add ifelse function and underlying intrinsic select_value. closes #4451