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.

Object::useCustomClass was intentionally avoided here because this method really should be deprecated in favour of using the Injector pattern.