(#18764) Add methods for enumerable functions.

This adds support for the functions/methods collect, reject, select, and
reduce. This implementation depends on support for lambdas being added
in puppet as described in issue #11331). Which probably will be released
in puppet 3.2.