[fix] CDATA for scripts and styles in XHTML documents. Fixes #906. Fixes #3993
[imp] Sql optimise admin get list of tags. Fixes #4114

removed distinct clause

re added the DISTINCT clause

Improve readability of where clause to get tags