Add support for template hierarchies.

Support for '.' in template names:
  template A.B.C { ... }