modified subs to recursively look for functions;
recursion over N test passed.
Should change other recursion/induction functions to lambdas to avoid covariance issues.
Should also deprecate implicit conversions from types to IdReps.