Implement the __if and __else keywords

fixes #7824