Add ifexpr ternary function to ExpressionBuilder

Closes #4338.