API Singleton method allowing type inference
This pattern improves over the current usage of singleton by allowing type inference.
This also better supports refactor, code usage detection, and auto-completion of classes.
Merge pull request #3007 from tractorcow/pulls/singleton

API Singleton method allowing type inference