support for ifelse() in expressions, closes #8