Tag functionality for annotations
Fix leaking of some variables
Add in renaming of tags