Added a factory method to create SGDocument objects that automatically saves the document to disk