fix stale revision properties in Database change listeners

Since registered change listeners were called before the cached
document's revision history was updated, some revision-related document
getters would return stale data.

Updating the document's revision history before notifying the database's
listeners lets change listeners see the latest data.