Splits endpoint and service configuration into their own objects. Also makes the endpoint and service configuration tests correct - there was a race condition previously that meant tests were passing but not checking correct code.