refactoring + more tests

Testing: search result numbers, tags, more tags, filtering by tags,
other