Add support for multi-way ifs (fixes #8)