Issue 1673 - Implement the isTemplate trait.

http://d.puremagic.com/issues/show_bug.cgi?id=1673

A rework of https://github.com/D-Programming-Language/dmd/pull/1239, this time implementing an `isTemplate` trait.

@9rnsr @yebblies: Are the two checks in `bool isTemplate(Dsymbol *s)` good enough?