Horde replacement for serialize()/json_encode() that will automatically use the
most efficient serialization available based on the input.
