Singleton pattern implementation with support for specific instances per subclass.