(maint) Add optional_parameter_count method to Closure

Add a method to return number of optional parameters on
Puppet::Pops::Evaluator::Closure just like Puppet::Parser::AST::Lambda
has.
(maint) Fix syntax error in example code
(PUP-1029) Add Enumeration - common place to produce an Enumerator.

The support for creating an Enumerator was in different places
(in each of the iterative functions, and in the type calculator).

This commit break out the behavior to a common class; Enumeration.
(PUP-1029) Make filter function use common Enumeration support.

This makes the filter function use the common Enumeration support
and makes it consistent with how all iterative functions should behave.

The function's documentation is also updated.
(PUP-1029) Make map function use common Enumeration support.

This makes the map function use the common Enumeration support.
(PUP-1029) Make each function use the Enumeration support.

This makes the each function use the common Enumeration support.
Documentation is also updated.
(PUP-1029) Make reduce functon use common Enumeration support.

This makes the reduce function use the common Enumeration support.
Documentation is updated.
Merge pull request #2330 from dalen/maint_application_comment

(maint) Fix syntax error in example code
(PUP-1029) Make the slice function use the common Enumeration support.

This adds use of the common Enumeration support to the slice function.
The documentation of the function is also updated.
(PUP-1029) Fix problem with class Enumerator btw. 1.8.7 and 1.9.3

The Enumerator class is in Enumerable::Enumerator in 1.8.7, and is
global from 1.9.3. 

This changes the tests to check if result responds to :next instead.
Merge pull request #2314 from dalen/lambda_optional_param_count

(maint) Add optional_parameter_count method to Closure
Merge pull request #2334 from jpartlow/issue/master/pup-1574-dir-envs-prevent-applying-cmdline-manifest

(PUP-1574) Environment setting does not override apply/parser manifest
(PUP-1029) Fix problem with Enumerator for String chars on Ruby 2.0.0

Ruby 2.0.0 does not return an Enumerator when calling String#chars,
instead an Array with the characters is returned.

Ruby 1.8.7 returns Enumerable::Enumerator, and 1.9.3 returns Enumerator.

Long live API stability !
Merge pull request #2332 from hlindberg/pup-1029_filter-function-serving-size

(PUP-1029) Make iterative functions more consistent
fix regular expression in ClassGen#is_constant_defined?
(PUP-1029) Make map function consistent with others

The map function only supported a single argument which made it
impossible to map based on index in an Array, and made in awkward
to map on only hash key or value.

Now the map function accepts either value (as before), or index/value,
or key/value (for hash).
Merge pull request #2337 from hlindberg/pup-1029_map-function-consistency

(PUP-1029) Make map function consistent with others
(PUP-1029) Update documentation of map function

Updates documentation of the map function to also show examples
of using index/value, key/value.
(PUP-753) Write a JMeter CSV log

This adds a JMeter format CSV log of the benchmark runs. This log will
allow us to track the performance over time via Jenkins and the
Performance plugin.
Merge pull request #2335 from ptomulik/fix/classgen_regexp

fix regular expression in ClassGen#is_constant_defined?