Big refactor of exception serialization support.