remove special iterable handling from demo
simplify the macro when function by relying more heavily on inference.  fixes empty completions for when().  add flatMap