The refactored version uses a more flexible approach to querying revisions. This will facilitate the necessary changes for #47. It also allows to acquire all required information in one query which at least in theory should be faster. Original pull request: #195.