As discussed yesterday, a first draft of merging the keyserver and the userapi.
QueryDeviceMessages
Adds tests for `QueryDeviceMessages` and also includes some optimizations to reduce allocations in the DB layer.