Improve serialization interface.

This interface change finally appears to be flexible enough for arbitrary
hooking and extension without sacrificing performance.

Improvements and fixes:

- The befriend access struct took an argument by value and invoked the copy
  constructor during serialization.

- The new free functions "read" and "write" are now the default interface for
  (de)serializing objects.

- The new free functions "read_object" and "write_object" allow for writing
  serializable types in the wire format as objects, i.e, prefixed with their
  global type information. This feature is important to achieve value semantics
  in cases when an heap-allocated "object" does not fit well.