Add lazy evaluation support to expression functions

Add if(cond, true, false) function using lazy evaluation feature
Fix use of uninitialized values when no ellipsoid set (fix #11848)
Fix use of uninitialized value