Change all functions to lambdas in feature prune.

This is done simply to pass in less parameters and, thus, clean up the
code.