Add asSingleton() and ServiceFactoryTest example