Add up to 20 repeats of mixfix control structures

The definitions of many control structures in the prelude were defined
multiple times for an increasing number of parts, to produce control
structures of larger size. Now these definitions exist internally, and
each control structure may be used with up to twenty uses of the
repeating part. The elseif() part has been renamed to elseIf() for
consistency, and try() catch*() finally?() now has generic parameters
over the result. The MatchFailure object has been moved into the
exception definitions as a result.

The match result objects have had their result method renamed to value,
for consistency with the corresponding paper. A Nothing pattern has been
introduced which matches nothing, to indicate definite failure.
Extend the exception interface and hierarchy

Exceptions now provide methods for retrieving information from their
backtraces, as well as access to the backtrace itself. The hierarchy of
errors has been split between the pre-existing Internal Error, which
represents a bug in the interpreter; Runtime Error, which indicates an
error in the runtime due to an erroneous program; and Logic Error, which
indicates an error as a result of a program that is semantically correct
but which has nonetheless produced an error. Two, unused classes of
exceptions now exist in the prelude, for future use, as well as a new
Logic Error that indicates use of an abstract method.

To facilitate this change, adds a fold() startingWith() method to
sequence (and therefore strings), and has made the tidy up of the
backtrace following use of assert() more consistent and reliable. A new
pattern called 'Foreign' has also been added, which matches against
JavaScript objects that are not Grace objects.
Rename the Event* types to Procedure*

The name Event was chosen because it often appeared as a response to an
event, but it does not actually represent an event. The family of types
has been renamed to Procedure, as this reflects their status as objects
which take some input and produce no output.
Retrieve dialect methods directly from the object

The existing dialect mechanism required that the object set to 'self' at
the top-most scope, but also that all the method names appeared in the
scope object. Now the searchScope method will look in self when it
reaches the top. This resolves a bug where custom dialects would not
respond to outer, as they did not have their methods copied into scope.
Ensure delegation sets the appropriate self value

The value of self in a Grace-defined method is always bound to the
surrounding scope, even if the actual method is called with a different
context. Now Grace methods will look at the context they were called in
and swap out the calling self if the two are different. This allows the
delegateTo() method to set the self value to the calling object.

Note that, because the value of self no longer necessarily reflects the
surrounding environment, a local search must look in both self and
scope, in the at order.
Resolve confidential errors after object creation

The confidential override error was raised if a method was added that
was not confidential while a confidential method was already attached to
the object. However, this was always the case when a confidential method
was already attached, because the annotations on the new method had not
been run yet. Now confidential validation is performed after annotations
are run.
Override base asString as early as possible

The existing stringification extension in the compiler happened after
the object's constructor had run, meaning that objects would have the
base asString during their construction and the specialised form
afterwards. Now the extension happens alongside the check for
confidential overrides, at the top of an object's inheritance hierarchy
and right before any constructor code runs.

The default overriding checker has been updated to handle existing code
in an object's prototype, meaning the asString method can no longer be
overridden by a variable.
Add general property indexes on foreign objects

All non-Grace objects now implicitly feature the methods at() and
at() put(), which correspond to a direct property getter and setter
respectively. Note that this translates to zero-indexed access on
JavaScript strings and arrays.
Add single argument methods from Math onto Number

The Number implementation has been fleshed out with methods from the
JavaScript Math object that operate on single numbers. Operations that
produce NaN raise Not A Number. The Number type has been extended to
include both the new types and some missing old ones, and a new type
'Order' has been introduced that includes the comparison operators.
Add string utilities to String

The String implementation has had a number of utilities added to it,
including ordering, find and replace and index searching. The index
searching should also be on Sequence, but it is harder to implement due
to the JavaScript indexOf not allowing a custom comparator. The String
type has been updated to include these utilities.
Move setimmediate import to appropriate module

The import of the setimmediate module was in the interpreter rather than
in task, which produced an issue of import order if setImmediate was not
already present in the system. Now the task module will import
setimmediate before setting anything else up, ensuring that it exists
before the task mechanism is used.
Add asPrimitive method to sequences

Sequences will now convert into JavaScript arrays when passed into
foreign functions. They will attempt to convert their contents to
primitives, if the appropriate method exists. This ensures that
sequences of objects that can be converted to primitives work seamlessly
with foreign definitions.
Use foreign lookup when objects in scope

When an object was a Grace object, but had methods which were foreign,
there was no coercion of parameters and result, and no special lookup
for built-in methods occurred. The same applied to objects which were
not Grace objects, but appeared in scope. Now the lookup only considers
whether the requested method is a Grace method, and is applied to
lookups on a self or outer object in scope.
Use self as receiver when requesting local methods

Unqualified requests to local methods always used null as the receiver.
This isn't an issue with regular Grace methods, as their value of self
is always retrieved from the surrounding scope rather than from 'this'.
However, Grace objects may inherit from internal definitions which do
use 'this', so now unqualified requests to these methods will no longer
have a null receiver.
Rename Nothing to None

The specification specifies the type which matches nothing as 'None'.
The existing Nothing type has been renamed to match this.
Add a simple mutable list class and type

The list factory inherits from the sequence factory, so the sequence
factory has been adjusted to call factory methods on self rather than on
an outer reference. The lists themselves inherit from sequences, which
now have a single own method 'internalArray'. This method is more
efficient than using asPrimitiveArray, as it provides a direct reference
to the underlying array instead of a clone, but it is confidential. The
list methods mutate this array.