compiler: Move ScopedArgument to right directory

This was in the frontend package but in the planner directory for some
reason
Initial procedure type support

- Add vt.ProcedureType to represent the fixed arguments, rest argument
  member type and return type of a procedure. This type explicitly
  disallow recursive types even inside its child types at the moment.

- Add support for static type checking of procedure types. This allows
  procedures types taking rest arguments to satisfy procedures types
  taking fixed arguments of a compatible type. For example, (+) satifies
  the type (-> <number> <number> <number>)

- Have et.Lambda track its procedure type explicitly. This replaces
  explicitly tracking the rest argument type explicitly

- Factor ModuleBodyExtractor.createLambda in to ExtractLambda and add
  support for reconciliing the procedure's signature with any forward
  type declarations

- Explicitly disallow checking for procedure types at runtime. We only
  support static type checks for procedures.
compiler: Properly type applied procedure value

- Ensure our operand types match the procedure type's argument types.
  For procedure's whose calling signature matches its procedure type
  this is a no-op

- Correctly cast the return value to the return type of the procedure
  type
compiler: Fix NameForTypeSuite test names
compiler: Track context location when forking plan

This is required to properly locate exceptions while planning type
checks. This has come up now that planning type checks for procedure
types.
compiler: Fix (procedure?) on higher order procs

- If a procedure supports inline application don't explicitly check all
  of its arguments types. There are only a few procedures that support
  inline application so this is hopefully not a correctnes issue within
  that limited set

- Make PlanTypeCheck properly take boxedValue by name to prevent
  boxing values when statically applying a type predicate

- Change LambdaSignatureSuite to use (raise) instead of (procedure?) to
  force the procedure to be planned

- Add unit tests for SatisfiesType on higher order procedure types. This
  worked correctly but wasn't explicitly tested.
compiler: Give KnownProcs unchangeable types

Override withSchemeType and castToSchemeType to ensure that KnownProc
values don't change Scheme types. This ensures their signatures can't
get out of sync with their Scheme types which means we can avoid
explicitly checking their operand types when applying them inline.
codegen and runtime support for typed entry points

- Change ProcedureCell to not have an explicit type for its entryPoint
  field. Previously it was typed to AdaptedProcedureSignature but soon
  various entry point types will be allowed

- Introduce TypedProcedureCell which requires an explicit signature for
  its entry point. Move ProcedureCell::apply() to TypedProcedureCell as
  untyped ProcedureCells are no long applicable

- Introduce TopProcedureCell as a type alias corresponding to the
  AdaptedProcedureSignature type of (-> <any> * *).

- Convert any users of ProcedureCell in the runtime and stdlib that
  required apply() to TopProcedureCell. Once the planner supports typed
  entry points these will be converted to more specific entry point
  types

- Update codegen to deal with the lack of cell type in ProcedureCell

- Have ps.LoadProcedureEntryPoint take a ProcedureSignature parameter to
  indicate the signature of the loaded entry point. Currently the
  planner always passes AdaptedProcedureSignature here
compiler: Remove AdaptedProcedureSignature

- Rename vt.ProcedureType to vt.SpecificProcedureType and introduce
  vt.ProcedureType trait that includes SpecificProcedureType and
  TopProcedureType.

  This is analogous to what vt.PairType does and allows determining the
  signature for a procedure type without special casing TopProcedureType

- Add ProcedureTypeToAdaptedSignature that will convert a given
  procedure type in to a procedure signature. This is fairly trivial -
  most fields are copied completely and a world and self argument are
  assumed.

- Remove AdaptedProcedureSignature. Instead use
  ProcedureTypeToSignature(vt.TopProcedureType). In the future this will
  be changed to use the particular procedure type that's required.
compiler: Add toProcedureTempValue

This separates toProcedureTempValue() from toBoxedValue() because
different procedure types will require different boxed representations.
Currently this will just create a TopProcedureCell but in the future it
will be generate entry points of the correct type.
compiler: Normalize specific procedure union types

It's not possible to perform runtime tests to distinguish procedure
types from each other. This means that a procedure type union would not
be resolvable by our generated code. Instead collapse unions containing
multiple specific procedure types in to the procedure top type.
compiler: Support for typed trampolines

Instead of always building a trampoline using the TopProcedureType build
a trampoline for the target type. This uses a generalised version of
PlanProcedureTrampoline that can deal with arbitrary incoming
signatures.
compiler: Support for procedure types in unions

This adds the concept of "adapter procedures". These are like normal
trampolines except they store the actual target procedure cell inside
their closure. This allows them to adapt other procdure cells instead of
just known procedures.

The planner now keeps track of these adapters in a new
adapterProcTrampolines. The same trampoline can be reused for different
adapter procedures that are adapting the same types.

Inside IntermediateValue determine if we're converting between unions
containing different procedure types and creating an adapter procedure
as required. This adds a fair amount of overhead when dealing with
procedure type union conversions but they should hopefully be rare in
practice.
stdlib: Add proc types to exception procedures

This ensures that the exception procedures are passed lambdas of the
correct type. It also generates slightly better code.
compiler: Add proc types to (dynamic-wind)

- Promote ThunkProcedureCell to a proper binding type. It's used
  frequently enough the stdlib to deserve a central definition

- Make (dynamic-wind) take a thunk procedure cell for all of its
  arguments
Add typed converter procedures

This adds an explicit type to converter procedures. When optimisation is
enabled this allows them to be invoked more efficiently and their arity
to be checked at compile time.
compiler: Fix adapaters without rest args

If an adapter without rest args was adapting a procedure with rest arg
and their fixed arg count matched we'd generate an bad Invoke call.
Handle this case and add a functional test.
stdlib: Add proc types to control procedures

This adds typed procdures to (call/cc) and (call-with-values). This
fixes a serious bug where (call/cc) would take a value of <any> and
attempt to apply it as a procedure, resulting in a segfault if the value
wasn't a procedure.
compiler: Don't explcitly cast in PlanInvokeApply

The planner can no longer have procedure types with differing Scheme
types and signatures - casting to another Scheme type will create an
adapter procedure. This means we're no longer required to check that the
applied operands match the Scheme type.
compiler: Avoid adapters for compatible procedures

Previously we were checking that procedure signatures were exactly
identical and if not we created an adapter procedure cell. This isn't
strictly required - if all possible applications of the target signature
will transparently satisfy the current signature we can just use the
existing entry point and procedure cell. The fact we track procedure
types in the compiler frontend means it won't be possible to invoke the
procedure with the original, less restrictive signature.