Expose an std::function interface for registering object_t methods.
Expose an std::function interface for registering object_t methods.

Summary:
Also use a lambda instead of std::bind (which is evil)

Things I wanted to do, but did not:
- Actually use the cache as a cache. It is currently being used so `at() const` can return a `const N&`, however it is also being updated inplace with every call. As `at()` is `const`, this would be very strange if the method is not pure, while if it is pure, then there is no need to call it again.
- Change register_methods to "last writer wins" or "last writer fails". Right now the failure is silently ignored.
- Change the signature of register_methods, to require that the member function be const, as it is only invoked from the const function `at()`.

Reviewed By: yfeldblum

Differential Revision: D24628513

fbshipit-source-id: cfa816f8ae4df727d7d5eb729d58f9c806db6f35

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift