Support for snapshot/deserializer.

This requires emitting relocations for external references and code
targets where appropriate as well as supporting the
architecture-dependent interfaces used by the deserializer.