Implemented Equals() for Template.cs, which fixes some problems.
Amended the template equality check to take namespaces into account.