count unread db implementation + tests