Add support for C++ object registration.

In addition, this adds partial specializations for Fun and ClassFun
to permit calling of functions that do not return values.