(PUP-514) Add support for optionally typed parameters.

This adds support for typed parameters in the ast model, the
grammar, and factory.

At this point, the information is only remembered, but not acted on.
(PUP-514) Add test for parsing of typed parameters

This updates the tree dumper to dump parsed type information
for parameters.
(PUP-514) Add validation and test of 'captures-last' parameters

This validates that only functions may have captures-last, and
that it may only be placed last amon the parameters.
(PUP-514) Add test for validation of 'captures rest' in lambdas
(PUP-514) Support last_captures_rest for lambdas

This adds the ability to define a lambda with "last-captures-rest"
semantics and to call it.
As a consequence, when a lambda with last captures rest semantics is
given to one of the iterative functions, a serving size of two
parameters is assumed
(PUP-514) Add support for opt-in typing of define/class parameters

This makes define and class parameters support optionally typed
parameters when using the future parser. The type expressions
are evaluated by the Pops Bridge when parameters are transformed t 3x.
The 3x parameters are not aware of type information (they are encoded as
arrays), and changes to all the logic that deals with parameters turned
on to not be a good design. The resource type and resource is instead
made aware of the opt-in types via a separate param-name to type map
that it applies in the validation step that was already performed.
(maint) Improve comment and formatting in test.
(PUP-514) Change warning to debug, and add validation of type expr

This changes the warning issued on the code path when a resource type
is required in order to do deserialization (apply phase). When this
happens on the server side (or during apply), the full source is
available, and the type in "known resource types" is loaded code that
may have typed parameters. This second time, no validation can and will
not take place because it is happening where there is no top scope
available. (This is fine, and should use result in a debug output).

This also fixes a couple of typos.
(PUP-514) Fix issue with case when inferring a Resource type

When the type calculator was inferring a Resource type, it assigned
an upper case name to the type_name in the resulting PResource type.
It should have assigned a lower case name.
(PUP-514) Change Puppet::Resource inferece to be Type[Resource]

This changes the inference of a Puppet::Resource to be
Type[Resource], instead of Resource. This because a Puppet::Resource
plays the same role as PResourceType - it is a reference to either
all instances of a resource type, or to one specific resource type.
(PUP-514) Accept Resource, or Type[Resource] when forming relationship

This makes forming relationships possible using either a
Types::PResourceType (or hostclass type) and a
PType[Types::PResourceType].

This was changed to allow Puppet::Resource to have the same semantics
as a PResourceType. (Currently 3x expressions produces instances
of PResourceType as the result of a resource expression, this is not
transformed back to a PResourceType, instead it is inferred to be
Type[Reource].
(maint) Remove pending tests for parsing functions in puppet
(PUP-514) Make Puppet::Resource behave as PResourceType wrt access

This makes Puppet::Resource behave as a PResourceType when using
the access operator; to detail a type with a title, or to
access a parameter of a typed/titled resource.

This is done to make differences between 3x and future planned catalog
builder transparent. 4x uses PResourceType as a reference to a
resource (handle/future ref), where 3x uses instances of
Puppet::Resource for both the instance, and references to it.
(PUP-514) Improve/add tests for typed parameters define/class
(PUP-514) Improve testing of typed parameters

This improves testing of typed parameters, and the ivolved
tests in general. One test moved from being an evaluation test
(it only tested parsing).

Iterative function testing changed to use better matchers.
(PUP-514) Clean up logic, remove dead code, improve naming.

This fixes up issues pointed out in the review of PR-2690.
(PUP-514) Fix assignability of 0 min Tuples

The assignability logic didn't consider an empty Tuple (Tuple) to be assignable
to a Tuple of min size 0 (Tuple[Object, 0, default]). This prevented the
case of a Callable that represented with only varargs from being called
with no arguments (Callable[Object, 0, default], Tuple).

The mistake was that after the check that the sizes of the tuples were
compatible, it then used the *max* of the two tuple's type parameters to
determine if the two are compatible. However, only the list of types in
the right hand side tuple matter in determining assignability.
(PUP-514) Create "with" function

The with function is needed in order to easily try out invoking lambdas.
Because this kind of thing can also be generally useful to anyone who
wants to learn the puppet language (understand lambdas, for instance) or
want to have a way of creating private scopes within a class, the with
function is being added as a normal APIv4 function rather than something
that is only available in tests.
(PUP-514) Add tests for lambdas

The work so far has not been able to deal with type checking lambdas.
This adds tests for the conditions that will need to be handled for
lambdas to properly type check their arguments. Currently none of these
new tests pass.
(PUP-514) Extract block evaluation into evaluator

The code for handling closure calls was mostly in the evaluator, but in
order to get the type checking correct, the split was becoming difficult
to deal with. This changes it so that closures are implemented in the
compiler as evaluation of blocks in a new scope with a given set of
variable bindings. This moves all of the argument handling into the
closure class, which will combine better with type checking.