Used std::function to solve VS 2010 issues with std::bind and lambdas

More troubleshooting for the unit tests. Hopefully something isn't
horribley broken in the rest of the lib now.