moved the PHG* code to a more appropriate place.
added processing for @namespace and @template