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 would put the assembly and the providerType lines on a separate method and just have configuration logic in this method. (Similar to calculate application base path)