Enhance the if mangler to avoid creating a function

This closes #118