Add CustomBuildMessage, CustomReadMessage, and CustomPassMessage hook functions. These functions can be defined to use custom code to convert C++ objects to and from Cap'n Proto messages. They work similarly to existing CustomBuildField, CustomReadField, and CustomPassField hooks, except they can be defined as normal functions not template functions, so they should be easier to use and require less verbosity in most cases, although they are less flexible.
The unit tests added here are new but the feature was originally implemented in https://github.com/bitcoin/bitcoin/pull/10102 but and is being ported because it's a general purpose feature.