(PUP-514) Add optionally typed parameters

Optionally typed parameters adds the capability to define the type of a parameter in class, defined, and lambda expressions. Also intimately related is the ability to define the last lambda parameter to be a "captures rest" (which is not available for parameters to defines and classes since the instantiation calls to those are arg passing by name, and not by position).

The iterative functions are changed to support 'captures-last' (while not terribly important, it would be surprising if it did not work - it also enables testing 'captures last' without having to jump through too many hoops)