Singleton Documentation and Bugfix

Added documentation to the Singleton template.

Fixed a bug which would cause Singleton objects to enter an inconsistent internal state when destroyed.