Adds selection persistence for tags
Fixes search indexing
Adds deepcopying to templates