Extract interface from ServiceManager, convert some methods to extension methods, implement caching for GetService<T>() method, and make some methods virtual