Changes to documents.js to use expanded data model