Add more assertions and comments. Make JSON service and endpoint enumeration/filtering functions use context pointer only for diagnostics, rather than eg accessing the service catalog via the context pointer.
Genericise retrieval of endpoint URLs to handle public, private and internal URLs.
Correct some comments (copy'n'pasta from Swift header).