fixed %template declared within class, next to template declaration
added a few tests for C# nested classes support