Tiny bit more refactoring.
Added unread counter retrieval, new category interface.