Saving & Loading additions

added all of the save/load functions, and started to use variable
references (&$var) in foreach loops. Also, creation of object sort
method.