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`
extra line