Add singleton registry

* Adds SingletonRegistry for ensuring only a single
  object is registered at a given point.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>