Tagging (labeling) support.

Also, many bug fixes.