Bug in generating var names for an implicit base case reduction definition

Repeated var names were getting created, and that error wasn't being
caught as early as it should have been. We now check for name reuse
when defining a Func.

- Andrew