Now that we have C++11, turn simple functors into lambdas and remove a ton of boilerplate.

No intended functionality change.