Added `toFunction` util function;
Fixed bug in `average` function;
Few changes;
Merge branch 'lambdas' into 1.1.0