added some code to make backward compatible and also started fleshing out the 'save' method for documents
updated parameter to dbref