pub fn minimize_references( object: &Object, references: Vec<Object>, ) -> (Object, Vec<Object>)
Represent the marshal data in the most efficient way possible. Add references to every object and then optimize them.