Allow switch to work with named_args

This extends `switch`, allowing it to support either or both positional and named arguments. With the same motivation provided in #126, this is an alternative to #127.