Allowing custom icons for templates

To be merged into 3.5 (not 3.4)
Closes #479