Implements document.lastModified for #2972