(maint) Add a :biff setting turning on biff, future parser/evaluator

The biff setting makes the runtime use 4x catalog builder, scope,
function API. Most things will not work until actual support has
been implemented. Expect feature by feature to migrate.
(PUP-2080) Add first cut of supporting functions written in .pp

This adds the required capabilities to lexer2, egrammar and parser.
Instantiation and calling of functions is not yet implemented. That will
be part of the new loader.
(PUP-2035) Add first cut of instantiators for functions and loader API
(maint) Add dir_containing(name, hash) to spec helpers

This makes it easy to mock a directory structure by giving it
a hash, where non hash entries are content, and hashes are directories.
(PUP-2035) Make loader infrastructure work for functions

This completes basic loader infrastructure for Puppet 4x.
It supports module loaders (from file and gem), static loader
(constants), and a minimal start configuring a puppet_system_loader
and an environment_loader.

Unit testing checks the basic behavior of the loaders.

TODO: configure module loaders based on their dependencies, and the top
most API how code in a module gets associated with its loader.
(PUP-485) Add function assert_type(t, value)

This function asserts that the value is an instance of the given type.
The value is returned or an error is raised.

This function use the new 4x function API.
(maint) Fix type calculator inference of Optional type

Inference of types was wrong, it used PObjectType where it should
have used PAbstractType - the result was that POptionalType was
inferred to be a Ruby regular class and not a type.
(maint) Improve documentation ofthe assert_type function
(PUP-485) Change format for actual type in assert_type error message

Instead of showing all details about the inferred type of the
given value, it is now made generic before output. This is good
for the simpler cases where it is confusing to see e.g. Integer[11,11]
when the value was 11 (an exact range). It does however mean that
information is "lost" when matching against more complex types. A more
complex "type diff" may be required to provide really good output.
Another alternative is to just display the value (not the type) of the
actual - but that may be very long if it is an Array or Hash.
(PUP-2035) (PUP-1799) Use new 4x loaders for 4x functions

This wires the new loaders (via the Puppet context) into the future
evaluator to make it lookup 4x functions via the new loader
infrastructure.

Currently, there is one function 'assert_type' available to be
called.

When the option Puppet[:biff] is true, all 3x functions are turned
into 4x functions. This is not fully operational yet, only functions
that do not rely on 3x scope features can be called that way.
(PUP-485) Fix test after change to ParseError from ArgumentError
(maint) Remove trailing comma that makes Ruby 1.8.7 have a hissy fit
(maint) Make Regexp type and Pattern type assert given pattern

This makes the type factory assert that patterns given to Regexp
and Pattern are valid regular expressions. Without this fix, this was
delayed until the type was used in a matching operation.
(PUP-485) Add ability to give assert_type a type as a String

This adds the ability to also give the type as a String (it is
parsed with the TypeParser). This is good when reading the type
specification from an external source that cannot directly serialize
a Puppet Type.
(PUP-2035) Add configuration of loaders from modules on module path
(maint) Remove trailing whitspace
(PUP-2035) Make loading from a module loader based on modulepath work

This adds a single module fixture and a test that loaders can be
defined for it, and that things can be loaded from the module
with functions found in the expected places.
Merge pull request #2493 from hlindberg/pup-2035_loader-infrastructure

(PUP- 2035) loader infrastructure
(PUP-1960) Make Resource and Class types produce [] on empty input

If Resource[expr], or Class[expr] are evaluated and the keys expr
results in an empty array after fattening and compaction, the operation
produces an empty array after giving a warning. 

This is helpful in situations where the expr is a function call that may
result in an empty array.

In this commit the ability to configure errors to produce warnings and
to allow configuration of severity has been added.
(PUP-1960) Reverse the order of compact and flatten

It is best to flatten before compacting.