Commonize code to limit functional tests to a single site each

@harshgMSFT @yishaigalatzer 

We should be doing this as boilerplate in all of our test sites or controllers start to leak across depending on the order of execution.


This is the best way I found to do it. Registering the service before calling `AddMvc()` is a no-op because `AddMvc()` will replace it. I didn't want to mess with implementing a custom `ILibraryManager`
I think GetTestConfiguration is a good addition as long as it returns a default configuration object if none is found through DI abstracting away whether we are running the site on a test or on a regular site.