Add support for tags.
Add querying by tag.
Refactor tag updating.