Use __isnull for querying a non-site specific template. Refs #33.
LUN-368 - fix top handle orphan templates adn templates assigned to shared sites (PBS)
Review and merge unique template used when duplicates are stored (LUN-368)

Defend agains the case when same template is being stored more than one
time